Class WindowSqlAggregate

java.lang.Object
org.apache.druid.sql.calcite.expression.WindowSqlAggregate
All Implemented Interfaces:
SqlAggregator

public class WindowSqlAggregate extends Object implements SqlAggregator
Conversion for SQL operators that map 1-1 onto native functions.
  • Constructor Details

    • WindowSqlAggregate

      public WindowSqlAggregate(org.apache.calcite.sql.SqlAggFunction operator)
  • Method Details

    • calciteFunction

      public org.apache.calcite.sql.SqlAggFunction calciteFunction()
      Description copied from interface: SqlAggregator
      Returns the SQL operator corresponding to this aggregation function. Should be a singleton.
      Specified by:
      calciteFunction in interface SqlAggregator
      Returns:
      operator
    • toDruidAggregation

      @Nullable public Aggregation toDruidAggregation(PlannerContext plannerContext, VirtualColumnRegistry virtualColumnRegistry, String name, org.apache.calcite.rel.core.AggregateCall aggregateCall, InputAccessor inputAccessor, List<Aggregation> existingAggregations, boolean finalizeAggregations)
      Description copied from interface: SqlAggregator
      Returns a Druid Aggregation corresponding to a SQL AggregateCall. This method should ignore filters; they will be applied to your aggregator in a later step.
      Specified by:
      toDruidAggregation in interface SqlAggregator
      Parameters:
      plannerContext - SQL planner context
      virtualColumnRegistry - re-usable virtual column references
      name - desired output name of the aggregation
      aggregateCall - aggregate call object
      inputAccessor - gives access to input fields and schema
      existingAggregations - existing aggregations for this query; useful for re-using aggregations. May be safely ignored if you do not want to re-use existing aggregations.
      finalizeAggregations - true if this query should include explicit finalization for all of its aggregators, where required. This is set for subqueries where Druid's native query layer does not do this automatically.
      Returns:
      aggregation, or null if the call cannot be translated