Search in sources :

Example 1 with DoublesSketchToStringPostAggregator

use of org.apache.druid.query.aggregation.datasketches.quantiles.DoublesSketchToStringPostAggregator in project druid by druid-io.

the class DoublesSketchSummaryOperatorConversion method toPostAggregator.

@Nullable
@Override
public PostAggregator toPostAggregator(PlannerContext plannerContext, RowSignature rowSignature, RexNode rexNode, PostAggregatorVisitor postAggregatorVisitor) {
    final List<RexNode> operands = ((RexCall) rexNode).getOperands();
    final PostAggregator firstOperand = OperatorConversions.toPostAggregator(plannerContext, rowSignature, operands.get(0), postAggregatorVisitor);
    if (firstOperand == null) {
        return null;
    }
    return new DoublesSketchToStringPostAggregator(postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), firstOperand);
}
Also used : RexCall(org.apache.calcite.rex.RexCall) DoublesSketchToStringPostAggregator(org.apache.druid.query.aggregation.datasketches.quantiles.DoublesSketchToStringPostAggregator) DoublesSketchToStringPostAggregator(org.apache.druid.query.aggregation.datasketches.quantiles.DoublesSketchToStringPostAggregator) PostAggregator(org.apache.druid.query.aggregation.PostAggregator) RexNode(org.apache.calcite.rex.RexNode) Nullable(javax.annotation.Nullable)

Aggregations

Nullable (javax.annotation.Nullable)1 RexCall (org.apache.calcite.rex.RexCall)1 RexNode (org.apache.calcite.rex.RexNode)1 PostAggregator (org.apache.druid.query.aggregation.PostAggregator)1 DoublesSketchToStringPostAggregator (org.apache.druid.query.aggregation.datasketches.quantiles.DoublesSketchToStringPostAggregator)1