use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class HllSketchToStringOperatorConversion 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 HllSketchToStringPostAggregator(postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), firstOperand);
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ThetaSketchEstimateWithErrorBoundsOperatorConversion 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;
}
if (!operands.get(1).isA(SqlKind.LITERAL)) {
return null;
}
final int errorBoundsStdDev = ((Number) RexLiteral.value(operands.get(1))).intValue();
return new SketchEstimatePostAggregator(postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), firstOperand, errorBoundsStdDev);
}
use of org.apache.druid.query.aggregation.PostAggregator 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);
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class ThetaSketchEstimateOperatorConversion 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 SketchEstimatePostAggregator(postAggregatorVisitor.getOutputNamePrefix() + postAggregatorVisitor.getAndIncrementCounter(), firstOperand, null);
}
use of org.apache.druid.query.aggregation.PostAggregator in project druid by druid-io.
the class TDigestSketchToQuantilesPostAggregatorTest method testComparator.
@Test
public void testComparator() {
expectedException.expect(IAE.class);
expectedException.expectMessage("Comparing arrays of quantiles is not supported");
PostAggregator postAgg = new TDigestSketchToQuantilesPostAggregator("post", new ConstantPostAggregator("", 100), new double[] { 0.25, 0.75 });
postAgg.getComparator();
}
Aggregations