Akshat-Jain commented on code in PR #17377:
URL: https://github.com/apache/druid/pull/17377#discussion_r1818376807
##########
sql/src/test/java/org/apache/druid/sql/calcite/util/TestDataBuilder.java:
##########
@@ -1014,6 +1039,40 @@ public static QueryableIndex
getQueryableIndexForDrillDatasource(String datasour
.buildMMappedIndex();
}
+ public static QueryableIndex getQueryableIndexForBenchmarkDatasource()
+ {
+ if (QUERYABLE_INDEX_FOR_BENCHMARK_DATASOURCE == null) {
+ throw new RuntimeException("Queryable index was not populated for
benchmark datasource.");
+ }
+ return QUERYABLE_INDEX_FOR_BENCHMARK_DATASOURCE;
+ }
+
+ public static void makeQueryableIndexForBenchmarkDatasource(Closer closer,
int rowsPerSegment)
+ {
+ if (closer == null) {
+ throw new RuntimeException("Closer not supplied for generating segments,
exiting.");
+ }
+
+ final GeneratorSchemaInfo schemaInfo =
GeneratorBasicSchemas.SCHEMA_MAP.get("basic");
+ final DataSegment dataSegment =
schemaInfo.makeSegmentDescriptor(CalciteTests.BENCHMARK_DATASOURCE);
+ final SegmentGenerator segmentGenerator = closer.register(new
SegmentGenerator());
+
+ List<DimensionSchema> columnSchemas = schemaInfo.getDimensionsSpec()
+ .getDimensions()
+ .stream()
+ .map(x -> new
AutoTypeColumnSchema(x.getName(), null))
+
.collect(Collectors.toList());
+ QUERYABLE_INDEX_FOR_BENCHMARK_DATASOURCE = segmentGenerator.generate(
Review Comment:
Pasting the row signature, and 5 sample rows:
```
signature = {__time:LONG, dimSequential:STRING, dimZipf:STRING,
dimUniform:STRING, dimSequentialHalfNull:STRING,
dimMultivalEnumerated:ARRAY<STRING>, dimMultivalEnumerated2:ARRAY<STRING>,
dimMultivalSequentialWithNulls:ARRAY<STRING>, dimHyperUnique:STRING,
dimNull:STRING, hyper:COMPLEX<hyperUnique>, maxLongUniform:LONG,
minFloatZipf:DOUBLE, rows:LONG, sumFloatNormal:DOUBLE, sumLongSequential:LONG}
new Object[]{946689120000L, "0", "49", "85847", null,
"[\"Baz\",\"Baz\",\"World\",\"Baz\"]", "[null,null,\"Orange\"]", null, "0",
null, "\"AQAAAQAAAAKkgA==\"", 429L, 347.0D, 1L, 5000.0D, 0L},
new Object[]{946693440000L, "1", "49", "85832", null,
"[\"World\",\"Baz\",\"World\",\"Baz\"]", "[null,\"Orange\",null]", null, "1",
null, "\"AQAAAQAAAAFREA==\"", 429L, 346.0D, 1L, 5000.0D, 1L},
new Object[]{946697760000L, "2", "3", "21503", "0",
"[\"Baz\",\"Foo\",\"Hello\",\"Bar\"]", "[\"Orange\",null,null]",
"[\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\"]", "2", null,
"\"AQAAAQAAAAOzAg==\"", 107L, 3.0D, 1L, 5000.0D, 2L},
new Object[]{946702080000L, "3", "91", "98132", "1",
"[\"Bar\",\"Foo\",\"Hello\",\"Baz\"]",
"[\"Xylophone\",\"Apple\",\"Corundum\"]",
"[\"9\",\"10\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\"]", "3", null,
"\"AQAAAQAAAAGdQA==\"", 490L, 869.0D, 1L, 5000.0D, 3L},
new Object[]{946706400000L, "4", "7", "44371", "2",
"[\"Bar\",\"World\",\"Baz\",\"Baz\"]",
"[\"Corundum\",\"Xylophone\",\"Apple\"]",
"[\"7\",\"8\",\"9\",\"10\",\"1\",\"2\",\"3\",\"4\"]", "4", null,
"\"AQAAAQAAAALwEA==\"", 221L, 16.0D, 1L, 5000.0D, 4L}
```
Does this help? Let me know if there's any specific aspect that you wanted
to know.
--
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]