org.eigenbase.sql.validate
Class AggFinder

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

 class AggFinder
extends SqlBasicVisitor<Void>

Visitor which looks for an aggregate function inside a tree of SqlNode objects.

Since:
Oct 28, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/AggFinder.java#11 $
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 over
           
 
Constructor Summary
AggFinder(boolean over)
          Creates an AggFinder.
 
Method Summary
 SqlNode findAgg(SqlNode node)
          Finds an aggregate.
 Void visit(SqlCall call)
          Visits a call to a SqlOperator.
 
Methods inherited from class org.eigenbase.sql.util.SqlBasicVisitor
visit, 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

over

private final boolean over
Constructor Detail

AggFinder

AggFinder(boolean over)
Creates an AggFinder.

Parameters:
over - Whether to find windowed function calls Agg(x) OVER windowSpec
Method Detail

findAgg

public SqlNode findAgg(SqlNode node)
Finds an aggregate.

Parameters:
node - Parse tree to search
Returns:
First aggregate function in parse tree, or null if not found

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)