Class HiveApplyProjectionUtil


  • public final class HiveApplyProjectionUtil
    extends Object
    • Method Detail

      • replaceWithNewVariables

        public static ConnectorExpression replaceWithNewVariables​(ConnectorExpression expression,
                                                                  Map<ConnectorExpression,​Variable> expressionToVariableMappings)
        Replace all connector expressions with variables as given by {@param expressionToVariableMappings} in a top down manner. i.e. if the replacement occurs for the parent, the children will not be visited.
      • find

        public static Optional<String> find​(Map<String,​ColumnHandle> assignments,
                                            HiveApplyProjectionUtil.ProjectedColumnRepresentation projectedColumn)
        Returns the assignment key corresponding to the column represented by {@param projectedColumn} in the {@param assignments}, if one exists. The variable in the {@param projectedColumn} can itself be a representation of another projected column. For example, say a projected column representation has variable "x" and a dereferenceIndices=[0]. "x" can in-turn map to a projected column handle with base="a" and [1, 2] as dereference indices. Then the method searches for a column handle in {@param assignments} with base="a" and dereferenceIndices=[1, 2, 0].