Class OperationExpressionsUtils
java.lang.Object
org.apache.flink.table.operations.utils.OperationExpressionsUtils
Utility methods for transforming
Expression to use them in QueryOperations.
Note: Some of these utilities are intended to be used before expressions are fully resolved and some afterwards.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContainer for extracted expressions of the same family. -
Method Summary
Modifier and TypeMethodDescriptionextractAggregationsAndProperties(List<org.apache.flink.table.expressions.Expression> expressions) Extracts and deduplicates all aggregation and window property expressions (zero, one, or more) from the given expressions.extractName(org.apache.flink.table.expressions.Expression expression) Extracts name from given expression if it has one.extractNames(List<org.apache.flink.table.expressions.ResolvedExpression> expressions) Extracts names from given expressions if they have one.static org.apache.flink.table.expressions.ResolvedExpressionscopeReferencesWithAlias(String aliasName, org.apache.flink.table.expressions.ResolvedExpression expression) Adds an input alias to allFieldReferenceExpressionin the givenexpression.static org.apache.flink.table.expressions.ResolvedExpressionscopeReferencesWithAlias(Map<Integer, String> inputAliases, org.apache.flink.table.expressions.ResolvedExpression expression) Adds an input alias to allFieldReferenceExpressionin the givenexpression.
-
Method Details
-
extractAggregationsAndProperties
public static OperationExpressionsUtils.CategorizedExpressions extractAggregationsAndProperties(List<org.apache.flink.table.expressions.Expression> expressions) Extracts and deduplicates all aggregation and window property expressions (zero, one, or more) from the given expressions.- Parameters:
expressions- a list of expressions to extract- Returns:
- a Tuple2, the first field contains the extracted and deduplicated aggregations, and the second field contains the extracted and deduplicated window properties.
-
extractNames
public static List<Optional<String>> extractNames(List<org.apache.flink.table.expressions.ResolvedExpression> expressions) Extracts names from given expressions if they have one. Expressions that have names are:FieldReferenceExpressionTableReferenceExpressionLocalReferenceExpressionBuiltInFunctionDefinitions.AS
- Parameters:
expressions- list of expressions to extract names from- Returns:
- corresponding list of optional names
-
extractName
public static Optional<String> extractName(org.apache.flink.table.expressions.Expression expression) Extracts name from given expression if it has one. Expressions that have names are:FieldReferenceExpressionTableReferenceExpressionLocalReferenceExpressionBuiltInFunctionDefinitions.AS
- Parameters:
expression- expression to extract name from- Returns:
- optional name of given expression
-
scopeReferencesWithAlias
public static org.apache.flink.table.expressions.ResolvedExpression scopeReferencesWithAlias(String aliasName, org.apache.flink.table.expressions.ResolvedExpression expression) Adds an input alias to allFieldReferenceExpressionin the givenexpression. -
scopeReferencesWithAlias
public static org.apache.flink.table.expressions.ResolvedExpression scopeReferencesWithAlias(Map<Integer, String> inputAliases, org.apache.flink.table.expressions.ResolvedExpression expression) Adds an input alias to allFieldReferenceExpressionin the givenexpression. This method accepts multiple aliases for given input indices.
-