maytasm commented on a change in pull request #10900:
URL: https://github.com/apache/druid/pull/10900#discussion_r585835212
##########
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:
There are compaction IT (existing ones) still use compaction spec
(/indexer/wikipedia_compaction_task.json) without granularitySpec (for example,
`testCompaction()`).
----------------------------------------------------------------
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]