Search in sources :

Example 1 with Between

use of org.apache.flink.orc.OrcFilters.Between in project flink by apache.

the class OrcColumnarRowInputFormatTest method testReadFileAndRestoreWithFilter.

@Test
public void testReadFileAndRestoreWithFilter() throws IOException {
    List<Predicate> filter = Collections.singletonList(new Or(new Between("_col0", PredicateLeaf.Type.LONG, 0L, 975000L), new Equals("_col0", PredicateLeaf.Type.LONG, 980001L), new Between("_col0", PredicateLeaf.Type.LONG, 990000L, 1800000L)));
    OrcColumnarRowInputFormat<?, FileSourceSplit> format = createFormat(FLAT_FILE_TYPE, new int[] { 0, 1 }, filter);
    // pick a middle split
    FileSourceSplit split = createSplits(flatFile, 1).get(0);
    int breakCnt = 975001;
    int expectedCnt = 1795000;
    long expectedTotalF0 = 1615113397500L;
    innerTestRestore(format, split, breakCnt, expectedCnt, expectedTotalF0);
}
Also used : Equals(org.apache.flink.orc.OrcFilters.Equals) Assert.assertEquals(org.junit.Assert.assertEquals) Or(org.apache.flink.orc.OrcFilters.Or) FileSourceSplit(org.apache.flink.connector.file.src.FileSourceSplit) Between(org.apache.flink.orc.OrcFilters.Between) Predicate(org.apache.flink.orc.OrcFilters.Predicate) Test(org.junit.Test)

Aggregations

FileSourceSplit (org.apache.flink.connector.file.src.FileSourceSplit)1 Between (org.apache.flink.orc.OrcFilters.Between)1 Equals (org.apache.flink.orc.OrcFilters.Equals)1 Or (org.apache.flink.orc.OrcFilters.Or)1 Predicate (org.apache.flink.orc.OrcFilters.Predicate)1 Assert.assertEquals (org.junit.Assert.assertEquals)1 Test (org.junit.Test)1