Package io.trino.plugin.hive
Class HiveApplyProjectionUtil
- java.lang.Object
-
- io.trino.plugin.hive.HiveApplyProjectionUtil
-
public final class HiveApplyProjectionUtil extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHiveApplyProjectionUtil.ProjectedColumnRepresentation
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static HiveApplyProjectionUtil.ProjectedColumnRepresentationcreateProjectedColumnRepresentation(ConnectorExpression expression)static List<ConnectorExpression>extractSupportedProjectedColumns(ConnectorExpression expression)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.static ConnectorExpressionreplaceWithNewVariables(ConnectorExpression expression, Map<ConnectorExpression,Variable> expressionToVariableMappings)Replace all connector expressions with variables as given by {@param expressionToVariableMappings} in a top down manner.
-
-
-
Method Detail
-
extractSupportedProjectedColumns
public static List<ConnectorExpression> extractSupportedProjectedColumns(ConnectorExpression expression)
-
createProjectedColumnRepresentation
public static HiveApplyProjectionUtil.ProjectedColumnRepresentation createProjectedColumnRepresentation(ConnectorExpression expression)
-
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].
-
-