Class OperationExpressionsUtils
- java.lang.Object
-
- org.apache.flink.table.operations.utils.OperationExpressionsUtils
-
@Internal public class OperationExpressionsUtils extends Object
Utility methods for transformingExpression
to use them inQueryOperation
s.Note: Some of these utilities are intended to be used before expressions are fully resolved and some afterwards.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OperationExpressionsUtils.CategorizedExpressions
Container for extracted expressions of the same family.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static Optional<String>
extractName(org.apache.flink.table.expressions.Expression expression)
Extracts name from given expression if it has one.static List<Optional<String>>
extractNames(List<org.apache.flink.table.expressions.ResolvedExpression> expressions)
Extracts names from given expressions if they have one.static org.apache.flink.table.expressions.ResolvedExpression
scopeReferencesWithAlias(String aliasName, org.apache.flink.table.expressions.ResolvedExpression expression)
Adds an input alias to allFieldReferenceExpression
in the givenexpression
.static org.apache.flink.table.expressions.ResolvedExpression
scopeReferencesWithAlias(Map<Integer,String> inputAliases, org.apache.flink.table.expressions.ResolvedExpression expression)
Adds an input alias to allFieldReferenceExpression
in the givenexpression
.
-
-
-
Method Detail
-
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:FieldReferenceExpression
TableReferenceExpression
LocalReferenceExpression
BuiltInFunctionDefinitions.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:FieldReferenceExpression
TableReferenceExpression
LocalReferenceExpression
BuiltInFunctionDefinitions.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 allFieldReferenceExpression
in 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 allFieldReferenceExpression
in the givenexpression
. This method accepts multiple aliases for given input indices.
-
-