org.eigenbase.sql.validate
Class AggChecker

java.lang.Object
  extended by org.eigenbase.sql.util.SqlBasicVisitor<Void>
      extended by org.eigenbase.sql.validate.AggChecker
All Implemented Interfaces:
SqlVisitor<Void>

 class AggChecker
extends SqlBasicVisitor<Void>

Visitor which throws an exception if any component of the expression is not a group expression.

Since:
Oct 28, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/AggChecker.java#14 $
Author:
jhyde

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.sql.util.SqlBasicVisitor
SqlBasicVisitor.ArgHandler<R>, SqlBasicVisitor.ArgHandlerImpl<R>
 
Field Summary
private  boolean distinct
           
private  List<SqlNode> groupExprs
           
private  Stack<SqlValidatorScope> scopes
           
private  SqlValidatorImpl validator
           
 
Constructor Summary
AggChecker(SqlValidatorImpl validator, AggregatingScope scope, List<SqlNode> groupExprs, boolean distinct)
          Creates an AggChecker.
 
Method Summary
(package private)  boolean isGroupExpr(SqlNode expr)
           
 Void visit(SqlCall call)
          Visits a call to a SqlOperator.
 Void visit(SqlIdentifier id)
          Visits an identifier.
 
Methods inherited from class org.eigenbase.sql.util.SqlBasicVisitor
visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scopes

private final Stack<SqlValidatorScope> scopes

groupExprs

private final List<SqlNode> groupExprs

distinct

private boolean distinct

validator

private SqlValidatorImpl validator
Constructor Detail

AggChecker

AggChecker(SqlValidatorImpl validator,
           AggregatingScope scope,
           List<SqlNode> groupExprs,
           boolean distinct)
Creates an AggChecker.

Parameters:
validator - Validator
scope - Scope
groupExprs - Expressions in GROUP BY (or SELECT DISTINCT) clause, that are therefore available
distinct - Whether aggregation checking is because of a SELECT DISTINCT clause
Method Detail

isGroupExpr

boolean isGroupExpr(SqlNode expr)

visit

public Void visit(SqlIdentifier id)
Description copied from interface: SqlVisitor
Visits an identifier.

Specified by:
visit in interface SqlVisitor<Void>
Overrides:
visit in class SqlBasicVisitor<Void>
Parameters:
id - identifier
See Also:
SqlIdentifier.accept(SqlVisitor)

visit

public Void visit(SqlCall call)
Description copied from interface: SqlVisitor
Visits a call to a SqlOperator.

Specified by:
visit in interface SqlVisitor<Void>
Overrides:
visit in class SqlBasicVisitor<Void>
Parameters:
call - Call
See Also:
SqlCall.accept(SqlVisitor)