Search in sources :

Example 6 with LogicalSegment

use of io.druid.timeline.LogicalSegment in project druid by druid-io.

the class TimeBoundaryQueryQueryToolChestTest method testMaxTimeFilterSegments.

@Test
public void testMaxTimeFilterSegments() throws Exception {
    List<LogicalSegment> segments = new TimeBoundaryQueryQueryToolChest().filterSegments(MAXTIME_BOUNDARY_QUERY, Arrays.asList(createLogicalSegment(new Interval("2013-01-01/P1D")), createLogicalSegment(new Interval("2013-01-01T01/PT1H")), createLogicalSegment(new Interval("2013-01-01T02/PT1H")), createLogicalSegment(new Interval("2013-01-02/P1D")), createLogicalSegment(new Interval("2013-01-03T01/PT1H")), createLogicalSegment(new Interval("2013-01-03T02/PT1H")), createLogicalSegment(new Interval("2013-01-03/P1D"))));
    Assert.assertEquals(3, segments.size());
    List<LogicalSegment> expected = Arrays.asList(createLogicalSegment(new Interval("2013-01-03T01/PT1H")), createLogicalSegment(new Interval("2013-01-03T02/PT1H")), createLogicalSegment(new Interval("2013-01-03/P1D")));
    for (int i = 0; i < segments.size(); i++) {
        Assert.assertEquals(segments.get(i).getInterval(), expected.get(i).getInterval());
    }
}
Also used : LogicalSegment(io.druid.timeline.LogicalSegment) Interval(org.joda.time.Interval) Test(org.junit.Test)

Aggregations

LogicalSegment (io.druid.timeline.LogicalSegment)6 Interval (org.joda.time.Interval)6 Test (org.junit.Test)6 ListColumnIncluderator (io.druid.query.metadata.metadata.ListColumnIncluderator)1 SegmentMetadataQuery (io.druid.query.metadata.metadata.SegmentMetadataQuery)1