private VectorExpression getCastToBinary(List<ExprNodeDesc> childExpr, TypeInfo returnType)
      throws HiveException {
    ExprNodeDesc child = childExpr.get(0);
    String inputType = childExpr.get(0).getTypeString();
    if (child instanceof ExprNodeConstantDesc) {
      // Don't do constant folding here.  Wait until the optimizer is changed to do it.
      // Family of related JIRAs: HIVE-7421, HIVE-7422, and HIVE-7424.
      return null;
    }
    if (inputType.equalsIgnoreCase(serdeConstants.STRING_TYPE_NAME) || varcharTypePattern.matcher(inputType).matches()) {

      // STRING and VARCHAR types require no conversion, so use a no-op.
      return getIdentityExpression(childExpr);
    } else if (charTypePattern.matcher(inputType).matches()) {
      return createVectorExpression(CastCharToBinary.class, childExpr, VectorExpressionDescriptor.Mode.PROJECTION,
          returnType, DataTypePhysicalVariation.NONE);
    }
    return null;
  }
Invoke special handling for expressions that can't be vectorized by regular
descriptor based lookup.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java