@Override
  void prepareResult(int i, long[] vector, BytesColumnVector outV) {
    long num = vector[i];
    // Extract the bits of num into bytes[] from right to left
    int len = 0;
    do {
      len++;
      bytes[bytes.length - len] = (byte) ('0' + (num & 1));
      num >>>= 1;
    } while (num != 0);
    outV.setVal(i, bytes, bytes.length - len, len);
  }
Vectorized implementation of Bin(long) function that returns string.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/FuncBin.java