Class GroupByScope

java.lang.Object
org.apache.calcite.sql.validate.DelegatingScope
org.apache.calcite.sql.validate.GroupByScope
All Implemented Interfaces:
SqlValidatorScope

public class GroupByScope extends DelegatingScope
Represents the name-resolution context for expressions in an GROUP BY clause.

In some dialects of SQL, the GROUP BY clause can reference column aliases in the SELECT clause. For example, the query

SELECT empno AS x
FROM emp
GROUP BY x

is valid.

  • Method Details

    • getNode

      public SqlNode getNode()
      Description copied from interface: SqlValidatorScope
      Returns the root node of this scope. Never null.
    • validateExpr

      public void validateExpr(SqlNode expr)
      Description copied from interface: SqlValidatorScope
      Performs any scope-specific validation of an expression. For example, an aggregating scope requires that expressions are valid aggregations. The expression has already been validated.
      Specified by:
      validateExpr in interface SqlValidatorScope
      Overrides:
      validateExpr in class DelegatingScope