protected void func(LongColumnVector outputColVector, BytesColumnVector inputColVector, int batchIndex) {

    byte[] bytes = inputColVector.vector[batchIndex];
    final int start = inputColVector.start[batchIndex];
    final int length = inputColVector.length[batchIndex];
    try {

      switch (integerPrimitiveCategory) {
      case BOOLEAN:
        {
          boolean booleanValue;
          int i = start;
          if (length == 4) {
            if ((bytes[i] == 'T' || bytes[i] == 't') &&
                (bytes[i + 1] == 'R' || bytes[i + 1] == 'r') &&
                (bytes[i + 2] == 'U' || bytes[i + 2] == 'u') &&
                (bytes[i + 3] == 'E' || bytes[i + 3] == 'e')) {
              booleanValue = true;
            } else {
              // No boolean value match for 4 char field.
              outputColVector.noNulls = false;
              outputColVector.isNull[batchIndex] = true;
              return;
            }
          } else if (length == 5) {
            if ((bytes[i] == 'F' || bytes[i] == 'f') &&
                (bytes[i + 1] == 'A' || bytes[i + 1] == 'a') &&
                (bytes[i + 2] == 'L' || bytes[i + 2] == 'l') &&
                (bytes[i + 3] == 'S' || bytes[i + 3] == 's') &&
                (bytes[i + 4] == 'E' || bytes[i + 4] == 'e')) {
              booleanValue = false;
            } else {
              // No boolean value match for 5 char field.
              outputColVector.noNulls = false;
              outputColVector.isNull[batchIndex] = true;
              return;
            }
          } else if (length == 1) {
            byte b = bytes[start];
            if (b == '1' || b == 't' || b == 'T') {
              booleanValue = true;
            } else if (b == '0' || b == 'f' || b == 'F') {
              booleanValue = false;
            } else {
              // No boolean value match for extended 1 char field.
              outputColVector.noNulls = false;
              outputColVector.isNull[batchIndex] = true;
              return;
            }
          } else {
            // No boolean value match for other lengths.
            outputColVector.noNulls = false;
            outputColVector.isNull[batchIndex] = true;
            return;
          }
          outputColVector.vector[batchIndex] = (booleanValue ? 1 : 0);
        }
        break;
      case BYTE:
        if (!LazyUtils.isNumberMaybe(bytes, start, length)) {
          outputColVector.noNulls = false;
          outputColVector.isNull[batchIndex] = true;
          return;
        }
        outputColVector.vector[batchIndex] = LazyByte.parseByte(bytes, start, length, 10);
        break;
      case SHORT:
        if (!LazyUtils.isNumberMaybe(bytes, start, length)) {
          outputColVector.noNulls = false;
          outputColVector.isNull[batchIndex] = true;
          return;
        }
        outputColVector.vector[batchIndex] = LazyShort.parseShort(bytes, start, length, 10);
        break;
      case INT:
        if (!LazyUtils.isNumberMaybe(bytes, start, length)) {
          outputColVector.noNulls = false;
          outputColVector.isNull[batchIndex] = true;
          return;
        }
        outputColVector.vector[batchIndex] = LazyInteger.parseInt(bytes, start, length, 10);
        break;
      case LONG:
        if (!LazyUtils.isNumberMaybe(bytes, start, length)) {
          outputColVector.noNulls = false;
          outputColVector.isNull[batchIndex] = true;
          return;
        }
        outputColVector.vector[batchIndex] = LazyLong.parseLong(bytes, start, length, 10);
        break;
      default:
        throw new Error("Unexpected primitive category " + integerPrimitiveCategory);
      }
    } catch (Exception e) {

      // for any exception in conversion to integer, produce NULL
      outputColVector.noNulls = false;
      outputColVector.isNull[batchIndex] = true;
    }
  }
Convert input string to a long, at position i in the respective vectors.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/expressions/CastStringToLong.java