use of java.lang.Double.POSITIVE_INFINITY in project presto by prestodb.
the class TestOutputNodeStats method testStatsForOutputNode.
@Test
public void testStatsForOutputNode() {
PlanNodeStatsEstimate stats = PlanNodeStatsEstimate.builder().setOutputRowCount(100).addVariableStatistics(new VariableReferenceExpression(Optional.empty(), "a", BIGINT), VariableStatsEstimate.builder().setNullsFraction(0.3).setLowValue(1).setHighValue(30).setDistinctValuesCount(20).build()).addVariableStatistics(new VariableReferenceExpression(Optional.empty(), "b", DOUBLE), VariableStatsEstimate.builder().setNullsFraction(0.6).setLowValue(13.5).setHighValue(POSITIVE_INFINITY).setDistinctValuesCount(40).build()).build();
tester().assertStatsFor(pb -> pb.output(outputBuilder -> {
VariableReferenceExpression a = pb.variable("a", BIGINT);
VariableReferenceExpression b = pb.variable("b", DOUBLE);
outputBuilder.source(pb.values(a, b)).column(a, "a1").column(a, "a2").column(b, "b");
})).withSourceStats(stats).check(outputStats -> outputStats.equalTo(stats));
}
use of java.lang.Double.POSITIVE_INFINITY in project presto by prestodb.
the class TestSortNodeStats method testStatsForSortNode.
@Test
public void testStatsForSortNode() {
PlanNodeStatsEstimate stats = PlanNodeStatsEstimate.builder().setOutputRowCount(100).addVariableStatistics(new VariableReferenceExpression(Optional.empty(), "a", BIGINT), VariableStatsEstimate.builder().setNullsFraction(0.3).setLowValue(1).setHighValue(30).setDistinctValuesCount(20).build()).addVariableStatistics(new VariableReferenceExpression(Optional.empty(), "b", DOUBLE), VariableStatsEstimate.builder().setNullsFraction(0.6).setLowValue(13.5).setHighValue(POSITIVE_INFINITY).setDistinctValuesCount(40).build()).build();
tester().assertStatsFor(pb -> pb.output(outputBuilder -> {
VariableReferenceExpression a = pb.variable("a", BIGINT);
VariableReferenceExpression b = pb.variable("b", DOUBLE);
outputBuilder.source(pb.values(a, b)).column(a, "a1").column(a, "a2").column(b, "b");
})).withSourceStats(stats).check(outputStats -> outputStats.equalTo(stats));
}
Aggregations