**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.
|| executeNumber<Int8>(*column, out_vec, idx, input_rows_count, size_per_row)
                || executeNumber<Int16>(*column, out_vec, idx, input_rows_count, size_per_row)
                || executeNumber<Int32>(*column, out_vec, idx, input_rows_count, size_per_row)
                || executeNumber<Int64>(*column, out_vec, idx, input_rows_count, size_per_row)
                || executeNumber<Float32>(*column, out_vec, idx, input_rows_count, size_per_row)
                || executeNumber<Float64>(*column, out_vec, idx, input_rows_count, size_per_row)))
            {
                throw Exception{"Illegal column " + arguments[idx].column->getName()
                                + " of first argument of function " + getName(), ErrorCodes::ILLEGAL_COLUMN};
            }
        }
        return col_str;
    }
private:
    template <typename T>
    bool executeNumber(const IColumn & src_data, ColumnString::Chars & out_vec, const size_t & column_idx, const size_t & rows, const size_t & size_per_row) const
    {
        const ColumnVector<T> * src_data_concrete = checkAndGetColumn<ColumnVector<T>>(&src_data);
        if (!src_data_concrete)
        {
            return false;
        }
        for (size_t row = 0; row < rows; ++row)
        {
            out_vec[row * size_per_row + column_idx] = static_cast<char>(src_data_concrete->getInt(row));
        }
        return true;
    }
};
class FunctionBitmaskToArray : public IFunction