clintropolis commented on a change in pull request #11850:
URL: https://github.com/apache/druid/pull/11850#discussion_r738830505



##########
File path: 
server/src/test/java/org/apache/druid/server/coordinator/duty/NewestSegmentFirstPolicyTest.java
##########
@@ -935,6 +937,66 @@ public void 
testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentOri
     Assert.assertFalse(iterator.hasNext());
   }
 
+  @Test
+  public void 
testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentRollup()
+  {
+    // Same indexSpec as what is set in the auto compaction config
+    Map<String, Object> indexSpec = mapper.convertValue(new IndexSpec(), new 
TypeReference<Map<String, Object>>() {});
+    // Same partitionsSpec as what is set in the auto compaction config
+    PartitionsSpec partitionsSpec = 
NewestSegmentFirstIterator.findPartitinosSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(null,
 null));
+
+    // Create segments that were compacted (CompactionState != null) and have
+    // rollup=false for interval 2017-10-01T00:00:00/2017-10-02T00:00:00,
+    // rollup=true for interval 2017-10-02T00:00:00/2017-10-03T00:00:00,
+    // and rollup=null for interval 2017-10-03T00:00:00/2017-10-04T00:00:00
+    final VersionedIntervalTimeline<String, DataSegment> timeline = 
createTimeline(

Review comment:
       should we add a test that segments in the same compaction state with 
rollup are not re-compacted? or is that covered automatically by another test?

##########
File path: 
server/src/test/java/org/apache/druid/server/coordinator/duty/NewestSegmentFirstPolicyTest.java
##########
@@ -935,6 +937,66 @@ public void 
testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentOri
     Assert.assertFalse(iterator.hasNext());
   }
 
+  @Test
+  public void 
testIteratorReturnsSegmentsAsSegmentsWasCompactedAndHaveDifferentRollup()
+  {
+    // Same indexSpec as what is set in the auto compaction config
+    Map<String, Object> indexSpec = mapper.convertValue(new IndexSpec(), new 
TypeReference<Map<String, Object>>() {});
+    // Same partitionsSpec as what is set in the auto compaction config
+    PartitionsSpec partitionsSpec = 
NewestSegmentFirstIterator.findPartitinosSpecFromConfig(ClientCompactionTaskQueryTuningConfig.from(null,
 null));

Review comment:
       heh, there is a typo in there `findPartitinosSpecFromConfig` -> 
`findPartitionsSpecFromConfig`




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