private Object getScalarValue(ExprNodeConstantDesc constDesc)
      throws HiveException {
    String typeString = constDesc.getTypeString();
    if (typeString.equalsIgnoreCase("String")) {
      return ((String) constDesc.getValue()).getBytes(StandardCharsets.UTF_8);
    } else if (charTypePattern.matcher(typeString).matches()) {
      return ((HiveChar) constDesc.getValue()).getStrippedValue().getBytes(StandardCharsets.UTF_8);
    } else if (varcharTypePattern.matcher(typeString).matches()) {
      return ((HiveVarchar) constDesc.getValue()).getValue().getBytes(StandardCharsets.UTF_8);
    } else if (typeString.equalsIgnoreCase(serdeConstants.BOOLEAN_TYPE_NAME)) {
      if (constDesc.getValue() == null) {
        return null;
      }else{
        return constDesc.getValue().equals(Boolean.TRUE) ? 1 : 0;
      }
    } else if (decimalTypePattern.matcher(typeString).matches()) {
      return constDesc.getValue();
    } else {
      return constDesc.getValue();
    }
  }
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