Package org.apache.calcite.sql.validate
Class AggFinder
- java.lang.Object
-
- org.apache.calcite.sql.util.SqlBasicVisitor<java.lang.Void>
-
- org.apache.calcite.sql.validate.AggVisitor
-
- org.apache.calcite.sql.validate.AggFinder
-
- All Implemented Interfaces:
SqlVisitor<java.lang.Void>
class AggFinder extends AggVisitor
Visitor that looks for an aggregate function inside a tree ofSqlNode
objects and throwsUtil.FoundOne
when it finds one.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
AggFinder.AggIterable
Iterates over all aggregates.-
Nested classes/interfaces inherited from class org.apache.calcite.sql.util.SqlBasicVisitor
SqlBasicVisitor.ArgHandler<R>, SqlBasicVisitor.ArgHandlerImpl<R>
-
-
Constructor Summary
Constructors Constructor Description AggFinder(SqlOperatorTable opTab, boolean over, boolean aggregate, boolean group, AggFinder delegate)
Creates an AggFinder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SqlCall
findAgg(java.util.List<SqlNode> nodes)
SqlCall
findAgg(SqlNode node)
Finds an aggregate.(package private) java.lang.Iterable<SqlCall>
findAll(java.lang.Iterable<SqlNode> nodes)
Creates a copy of this finder that has the same parameters as this, then returns the list of all aggregates found.protected java.lang.Void
found(SqlCall call)
-
Methods inherited from class org.apache.calcite.sql.validate.AggVisitor
visit
-
-
-
-
Constructor Detail
-
AggFinder
AggFinder(SqlOperatorTable opTab, boolean over, boolean aggregate, boolean group, AggFinder delegate)
Creates an AggFinder.- Parameters:
opTab
- Operator tableover
- Whether to find windowed function callsagg(x) OVER windowSpec
aggregate
- Whether to find non-windowed aggregate callsgroup
- Whether to find group functions (e.g.TUMBLE
)delegate
- Finder to which to delegate when processing the arguments
-
-
Method Detail
-
findAgg
public SqlCall findAgg(SqlNode node)
Finds an aggregate.- Parameters:
node
- Parse tree to search- Returns:
- First aggregate function in parse tree, or null if not found
-
found
protected java.lang.Void found(SqlCall call)
- Specified by:
found
in classAggVisitor
-
-