clintropolis commented on code in PR #14542:
URL: https://github.com/apache/druid/pull/14542#discussion_r1262017575
##########
extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchAggregatorTest.java:
##########
@@ -417,6 +440,153 @@ public void testPostAggs() throws Exception
Assert.assertEquals(expectedSummary, ((HllSketchHolder)
row.get(4)).getSketch().toString());
}
+ @Test
+ public void testArrays() throws Exception
+ {
+ AggregatorFactory[] aggs = new AggregatorFactory[]{
+ new HllSketchBuildAggregatorFactory("hll0", "arrayString", null,
null, null, false, false, true),
+ new HllSketchBuildAggregatorFactory("hll1", "arrayLong", null,
null, null, false, false, true),
+ new HllSketchBuildAggregatorFactory("hll2", "arrayDouble", null,
null, null, false, false, true),
+ new HllSketchBuildAggregatorFactory("hll3", "arrayString", null,
null, null, false, false, false),
+ new HllSketchBuildAggregatorFactory("hll4", "arrayLong", null,
null, null, false, false, false),
+ new HllSketchBuildAggregatorFactory("hll5", "arrayDouble", null,
null, null, false, false, false)
+ };
+
+ IndexBuilder bob = IndexBuilder.create(timeseriesHelper.getObjectMapper())
+ .tmpDir(groupByFolder.newFolder())
+ .schema(
+ IncrementalIndexSchema.builder()
+
.withTimestampSpec(NestedDataTestUtils.TIMESTAMP_SPEC)
+
.withDimensionsSpec(NestedDataTestUtils.AUTO_DISCOVERY)
+ .withMetrics(aggs)
+
.withQueryGranularity(Granularities.NONE)
+ .withRollup(true)
+
.withMinTimestamp(0)
+ .build()
+ )
+ .inputSource(
+ ResourceInputSource.of(
+
NestedDataTestUtils.class.getClassLoader(),
+
NestedDataTestUtils.ARRAY_TYPES_DATA_FILE
+ )
+ )
+
.inputFormat(NestedDataTestUtils.DEFAULT_JSON_INPUT_FORMAT)
+ .transform(TransformSpec.NONE)
+ .inputTmpDir(groupByFolder.newFolder());
+
+ List<Segment> realtimeSegs = ImmutableList.of(
+ new IncrementalIndexSegment(bob.buildIncrementalIndex(),
SegmentId.dummy("test_datasource"))
+ );
+ List<Segment> segs = ImmutableList.of(
+ new QueryableIndexSegment(bob.buildMMappedMergedIndex(),
SegmentId.dummy("test_datasource"))
+ );
+
+ GroupByQuery query = GroupByQuery.builder()
+ .setDataSource("test_datasource")
+ .setGranularity(Granularities.ALL)
+ .setInterval(Intervals.ETERNITY)
+ .setAggregatorSpecs(
+ new
HllSketchBuildAggregatorFactory("a0", "arrayString", null, null, null, false,
false, false),
+ new
HllSketchBuildAggregatorFactory("a1", "arrayLong", null, null, null, false,
false, false),
+ new
HllSketchBuildAggregatorFactory("a2", "arrayDouble", null, null, null, false,
false, false),
+ new
HllSketchMergeAggregatorFactory("a3", "hll0", null, null, null, false, false),
+ new
HllSketchMergeAggregatorFactory("a4", "hll1", null, null, null, false, false),
+ new
HllSketchMergeAggregatorFactory("a5", "hll2", null, null, null, false, false),
+ new
HllSketchMergeAggregatorFactory("a6", "hll3", null, null, null, false, false),
+ new
HllSketchMergeAggregatorFactory("a7", "hll4", null, null, null, false, false),
+ new
HllSketchMergeAggregatorFactory("a8", "hll5", null, null, null, false, false),
Review Comment:
`processAsArrays` has no impact at query time because we have column type
information, the `processAsArrays` tests are the ingest time aggs creating the
pre-agg sketches
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]