Class AggFinder

  • All Implemented Interfaces:
    SqlVisitor<java.lang.Void>

    class AggFinder
    extends AggVisitor
    Visitor that looks for an aggregate function inside a tree of SqlNode objects and throws Util.FoundOne when it finds one.
    • Constructor Detail

      • AggFinder

        AggFinder​(SqlOperatorTable opTab,
                  boolean over,
                  boolean aggregate,
                  boolean group,
                  AggFinder delegate)
        Creates an AggFinder.
        Parameters:
        opTab - Operator table
        over - Whether to find windowed function calls agg(x) OVER windowSpec
        aggregate - Whether to find non-windowed aggregate calls
        group - 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
      • findAll

        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.