@SuppressWarnings("null")
  private VectorExpression createDecimal64VectorExpression(Class<?> vectorClass,
      List<ExprNodeDesc> childExprs, VectorExpressionDescriptor.Mode childrenMode,
      boolean isDecimal64ScaleEstablished, int decimal64ColumnScale,
      TypeInfo returnTypeInfo, DataTypePhysicalVariation returnDataTypePhysicalVariation,
      boolean dontRescaleArguments, GenericUDF genericUdf)
          throws HiveException {

    final int numChildren = childExprs.size();
    VectorExpression vectorExpression = null;
    boolean oldTryDecimal64Cast = this.tryDecimal64Cast;
    tryDecimal64Cast = true;

    /*
     * Custom build arguments.
     */

    try {
      List<VectorExpression> children = new ArrayList<>();
      Object[] arguments = new Object[numChildren];
      TypeInfo[] typeInfos = new TypeInfo[numChildren];
      DataTypePhysicalVariation[] dataTypePhysicalVariations = new DataTypePhysicalVariation[numChildren];

      for (int i = 0; i < numChildren; i++) {
        ExprNodeDesc childExpr = childExprs.get(i);
        TypeInfo typeInfo = childExpr.getTypeInfo();
        typeInfos[i] = typeInfo;
        dataTypePhysicalVariations[i] =
            (checkTypeInfoForDecimal64(typeInfo) ?
                DataTypePhysicalVariation.DECIMAL_64 : DataTypePhysicalVariation.NONE);
        if (childExpr instanceof ExprNodeGenericFuncDesc) {
          VectorExpression vChild = getVectorExpression(childExpr, childrenMode);
          if (genericUdf instanceof GenericUDFBaseBinary
            && vChild.getOutputDataTypePhysicalVariation() == DataTypePhysicalVariation.NONE) {
            return null;
          }
          children.add(vChild);
          arguments[i] = vChild.getOutputColumnNum();
        } else if (childExpr instanceof ExprNodeColumnDesc) {
          int colIndex = getInputColumnIndex((ExprNodeColumnDesc) childExpr);
          if (childrenMode == VectorExpressionDescriptor.Mode.FILTER) {

            VectorExpression filterExpr = getFilterOnBooleanColumnExpression((ExprNodeColumnDesc) childExpr, colIndex);
            if (filterExpr == null) {
              return null;
            }

            children.add(filterExpr);
          }
          arguments[i] = colIndex;
        } else if (childExpr instanceof ExprNodeConstantDesc) {
          ExprNodeConstantDesc constDesc = (ExprNodeConstantDesc) childExpr;
          if (typeInfo instanceof DecimalTypeInfo) {
            if (!isDecimal64ScaleEstablished) {
              return null;
            }
            HiveDecimal hiveDecimal = (HiveDecimal) constDesc.getValue();
            if (hiveDecimal.scale() > decimal64ColumnScale) {

              // For now, bail out on decimal constants with larger scale than column scale.
              return null;
            }
            if (dontRescaleArguments) {
              arguments[i] = new HiveDecimalWritable(hiveDecimal).serialize64(hiveDecimal.scale());
            } else {
              arguments[i] = new HiveDecimalWritable(hiveDecimal).serialize64(decimal64ColumnScale);
            }
          } else {
            Object scalarValue = getVectorTypeScalarValue(constDesc);
            arguments[i] = (scalarValue == null) ? getConstantVectorExpression(null, typeInfo, childrenMode) : scalarValue;
          }
        } else {
          return null;
        }
      }

      /*
       * Instantiate Decimal64 vector expression.
       *
       * The instantiateExpression method sets the output column and type information.
       */
      vectorExpression =
          instantiateExpression(vectorClass, returnTypeInfo, returnDataTypePhysicalVariation, arguments);
      if (vectorExpression == null) {
        handleCouldNotInstantiateVectorExpression(vectorClass, returnTypeInfo, returnDataTypePhysicalVariation,
            arguments);
      }

      Objects.requireNonNull(vectorExpression).setInputTypeInfos(typeInfos);
      vectorExpression.setInputDataTypePhysicalVariations(dataTypePhysicalVariations);

      if (!children.isEmpty()) {
        vectorExpression.setChildExpressions(children.toArray(new VectorExpression[0]));
      }
    } finally {
      tryDecimal64Cast = oldTryDecimal64Cast;
    }

    return vectorExpression;
  }
Used as a fast path for operations that don't modify their input, like unary +
and casting boolean to long. IdentityExpression and its children are always
projections.
ql/src/java/org/apache/hadoop/hive/ql/exec/vector/VectorizationContext.java