Class OperationExpressionsUtils
- java.lang.Object
-
- org.apache.flink.table.operations.utils.OperationExpressionsUtils
-
@Internal public class OperationExpressionsUtils extends Object
Utility methods for transformingExpressionto use them inQueryOperations.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 classOperationExpressionsUtils.CategorizedExpressionsContainer for extracted expressions of the same family.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OperationExpressionsUtils.CategorizedExpressionsextractAggregationsAndProperties(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.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 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: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.
-
-