suneet-s commented on a change in pull request #10900:
URL: https://github.com/apache/druid/pull/10900#discussion_r585714231
##########
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:
I think this means that there will always be a granulartySpec provided
as part of the compaction task spec. Do we have a test running a compact task
without specifying a granularitySpec. I'm trying to think of what happens in an
upgrade/downgrade scenario where the compaction job being submitted may not
have the granularitySpec as part of the compaction spec
----------------------------------------------------------------
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]