**Use case**

Viewing binary data such as bitmasks, hashes, internal representation of IEEE-754 numbers, etc.
Mostly for debugging.

**Describe the solution you'd like**

Similar to `hex`/`unhex`.

`bin` - returns a string with `0` and `1`. Bits are in "human" order, most significant first. Most significant zero bits are not printed (except the case with single zero).

**Describe alternatives you've considered**

Now I have to run interactive `python` from command line, but I will be more happy using ClickHouse.

**Caveats**

The name `bin` may suggest that the function will "split data into bins" but it is completely unrelated.
{
                const auto * address = &vec_in[offset];
                UInt8 zeroed_tail_bytes_count = isIPv4Mapped(address) ? ipv4_zeroed_tail_bytes_count : ipv6_zeroed_tail_bytes_count;
                cutAddress(reinterpret_cast<const unsigned char *>(address), pos, zeroed_tail_bytes_count);
                offsets_res[i] = pos - begin;
            }
            vec_res.resize(pos - begin);
            return col_res;
        }
        else
            throw Exception("Illegal column " + arguments[0].column->getName()
            + " of argument of function " + getName(),
            ErrorCodes::ILLEGAL_COLUMN);
    }
private:
    static bool isIPv4Mapped(const UInt8 * address)
    {
        return (unalignedLoad<UInt64>(address) == 0) &&
            ((unalignedLoad<UInt64>(address + 8) & 0x00000000FFFFFFFFull) == 0x00000000FFFF0000ull);
    }
    static void cutAddress(const unsigned char * address, char *& dst, UInt8 zeroed_tail_bytes_count)
    {
        formatIPv6(address, dst, zeroed_tail_bytes_count);
    }
};
class FunctionIPv6StringToNum : public IFunction
{
public:
    static constexpr auto name = "IPv6StringToNum";
    static FunctionPtr create(ContextPtr) { return std::make_shared<FunctionIPv6StringToNum>(); }