maytasm commented on code in PR #12600:
URL: https://github.com/apache/druid/pull/12600#discussion_r888783571
##########
server/src/test/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinatorTest.java:
##########
@@ -1133,6 +1169,74 @@ public void testUnusedHighRange() throws IOException
);
}
+ @Test
+ public void testUsedEternitySegmentEternityFilter() throws IOException
+ {
+
coordinator.announceHistoricalSegments(ImmutableSet.of(eternityRangeSegment1));
+
+ Assert.assertEquals(
+ ImmutableSet.of(eternityRangeSegment1),
+ ImmutableSet.copyOf(
+ coordinator.retrieveUsedSegmentsForIntervals(
+ eternityRangeSegment1.getDataSource(),
+ Intervals.ONLY_ETERNITY,
+ Segments.ONLY_VISIBLE
+ )
+ )
+ );
+ }
+
+ @Test
+ public void testUsedEternitySegment2000Filter() throws IOException
+ {
+
coordinator.announceHistoricalSegments(ImmutableSet.of(eternityRangeSegment1));
+
+ Assert.assertEquals(
+ ImmutableSet.of(eternityRangeSegment1),
+ ImmutableSet.copyOf(
+ coordinator.retrieveUsedSegmentsForIntervals(
+ eternityRangeSegment1.getDataSource(),
+ Collections.singletonList(Intervals.of("2000/2030")),
+ Segments.ONLY_VISIBLE
+ )
+ )
+ );
+ }
+
+ @Test
+ public void testUsedHalfEternitySegmentEternityFilter() throws IOException
+ {
+
coordinator.announceHistoricalSegments(ImmutableSet.of(halfEternityRangeSegment1,
halfEternityRangeSegment2));
+
+ Assert.assertEquals(
+ ImmutableSet.of(halfEternityRangeSegment1, halfEternityRangeSegment2),
+ ImmutableSet.copyOf(
+ coordinator.retrieveUsedSegmentsForIntervals(
+ halfEternityRangeSegment1.getDataSource(),
+ Intervals.ONLY_ETERNITY,
+ Segments.ONLY_VISIBLE
+ )
+ )
+ );
+ }
+
+ @Test
+ public void testUsedHalfEternitySegment2000Filter() throws IOException
Review Comment:
Took me a while wondering how this pass before realizing that there is a
filter done on the result return from sql
--
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]