adarshsanjeev commented on code in PR #17377:
URL: https://github.com/apache/druid/pull/17377#discussion_r1818342836


##########
extensions-core/multi-stage-query/pom.xml:
##########
@@ -352,6 +352,17 @@
                     </excludes>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>

Review Comment:
   Is this change needed for running benchmarks?



##########
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:
   What are the actual rows that are added to this datasource?



##########
sql/src/test/java/org/apache/druid/sql/calcite/SqlTestFrameworkConfig.java:
##########
@@ -301,7 +301,7 @@ public void beforeEach(ExtensionContext context)
       setConfig(context);
     }
 
-    private void setConfig(ExtensionContext context)
+    public void setConfig(ExtensionContext context)

Review Comment:
   nit: this could be renamed as it does not look like a setter, now that you 
have added an actual setter below.



##########
benchmarks/pom.xml:
##########
@@ -217,6 +227,13 @@
       <version>${project.parent.version}</version>
       <scope>test</scope>
     </dependency>
+    <dependency>
+      <groupId>org.apache.druid.extensions</groupId>
+      <artifactId>druid-multi-stage-query</artifactId>

Review Comment:
   This dependency is already present in this pom, could is this needed?



##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/test/CalciteMSQTestsHelper.java:
##########
@@ -416,6 +416,9 @@ protected static Supplier<ResourceHolder<CompleteSegment>> 
getSupplierForSegment
       case CalciteTests.T_ALL_TYPE_PARQUET:
         index = 
TestDataBuilder.getQueryableIndexForDrillDatasource(segmentId.getDataSource(), 
tempFolderProducer.apply("tmpDir"));
         break;
+      case CalciteTests.BENCHMARK_DATASOURCE:

Review Comment:
   Is there scope in reusing this datasource for anything else? If so, it could 
be renamed to a more general name. If not, I'm wondering if there is a better 
way to override this just for the one test.



-- 
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]

Reply via email to