maytasm commented on a change in pull request #10900:
URL: https://github.com/apache/druid/pull/10900#discussion_r585835894



##########
File path: 
integration-tests/src/test/java/org/apache/druid/tests/indexer/ITCompactionTaskTest.java
##########
@@ -164,18 +211,31 @@ private void loadData(String indexTask) throws Exception
     );
   }
 
-  private void compactData(String compactionResource, GranularityType 
newSegmentGranularity) throws Exception
+  private void compactData(String compactionResource, GranularityType 
newSegmentGranularity, GranularityType newQueryGranularity) throws Exception
   {
     String template = getResourceAsString(compactionResource);
     template = StringUtils.replace(template, "%%DATASOURCE%%", 
fullDatasourceName);
+    // For the new granularitySpec map
+    Map<String, String> granularityMap = new HashMap<>();
+    if (newSegmentGranularity != null) {
+      granularityMap.put("segmentGranularity", newSegmentGranularity.name());
+    }
+    if (newQueryGranularity != null) {
+      granularityMap.put("queryGranularity", newQueryGranularity.name());
+    }
+    template = StringUtils.replace(
+        template,
+        "%%GRANULARITY_SPEC%%",
+        jsonMapper.writeValueAsString(granularityMap)
+    );

Review comment:
       Basically, 
   ```
       template = StringUtils.replace(
           template,
           "%%GRANULARITY_SPEC%%",
           jsonMapper.writeValueAsString(granularityMap)
       );
   ```
   will be a no-op for those tests that uses compaction spec without 
granularitySpec (/indexer/wikipedia_compaction_task.json)




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

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