Class OperationExpressionsUtils

java.lang.Object
org.apache.flink.table.operations.utils.OperationExpressionsUtils

@Internal public class OperationExpressionsUtils extends Object
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.

  • 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:
      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:
      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 all FieldReferenceExpression in the given expression.
    • 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 all FieldReferenceExpression in the given expression. This method accepts multiple aliases for given input indices.