dongjoon-hyun commented on a change in pull request #934:
URL: https://github.com/apache/orc/pull/934#discussion_r727815721



##########
File path: java/core/src/test/org/apache/orc/impl/TestReaderImpl.java
##########
@@ -411,4 +415,35 @@ public void testGetRawDataSizeFromColIndices() throws 
Exception {
         ReaderImpl.getRawDataSizeFromColIndices(list, types, stats));
     }
   }
+
+  private void CheckFileWithSargs(String fileName, String softwareVersion)
+      throws IOException {
+    Configuration conf = new Configuration();
+    Path path = new Path(workDir, fileName);
+    FileSystem fs = path.getFileSystem(conf);
+    try (ReaderImpl reader = (ReaderImpl) OrcFile.createReader(path,
+        OrcFile.readerOptions(conf).filesystem(fs))) {
+      assertEquals(softwareVersion, reader.getSoftwareVersion());
+
+      Reader.Options opt = new Reader.Options();
+      SearchArgument.Builder builder = SearchArgumentFactory.newBuilder(conf);
+      builder.equals("id", PredicateLeaf.Type.LONG, 18000000000L);
+      opt.searchArgument(builder.build(), new String[]{"id"});
+
+      TypeDescription schema = reader.getSchema();
+      VectorizedRowBatch batch = schema.createRowBatch();
+      try (RecordReader rows = reader.rows(opt)) {
+        assertTrue(rows.nextBatch(batch), "No rows read out!");
+        assertEquals(5, batch.size);
+        assertFalse(rows.nextBatch(batch));
+      }
+    }
+  }
+
+  @Test
+  public void testSkipBadBloomFilters() throws IOException {
+    CheckFileWithSargs("bad_bloom_filter_1.6.11.orc", "ORC C++ 1.6.11");
+    CheckFileWithSargs("bad_bloom_filter_1.6.0.orc", "ORC C++ ");
+    CheckFileWithSargs("bad_bloom_filter_1.6.11-SNAPSHOT.orc", "ORC C++ 
1.6.11-SNAPSHOT");

Review comment:
       ditto. Please make a file dynamically if you want to test `-SNAPSHOT` 
postfix.




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


Reply via email to