pitrou commented on code in PR #1291:
URL: https://github.com/apache/parquet-mr/pull/1291#discussion_r1514270438
##########
parquet-hadoop/src/test/java/org/apache/parquet/hadoop/TestInterOpReadByteStreamSplit.java:
##########
@@ -67,7 +72,73 @@ public void testReadFloats() throws IOException {
break;
}
}
- assertTrue(reader.read() == null);
+ assertNull(reader.read());
}
}
+
+ private void compareColumnValues(
+ Path path, int expectRows, String leftCol, String rightCol,
FieldComparator comparator) throws IOException {
+ try (ParquetReader<Group> reader =
+ ParquetReader.builder(new GroupReadSupport(), path).build()) {
+ for (int i = 0; i < expectRows; ++i) {
+ Group group = reader.read();
+ assertNotNull(group);
+ comparator.assertFieldsEqual(group, leftCol, rightCol);
+ }
+ assertNull(reader.read());
+ }
+ }
+
+ @Test
+ public void testReadAllSupportedTypes() throws IOException {
+ Path extendedFile = interop.GetInterOpFile(EXTENDED_FILE, CHANGESET);
+ final int expectRows = 200;
+ compareColumnValues(
+ extendedFile, expectRows, "float_plain", "float_byte_stream_split",
((group, leftCol, rightCol) -> {
+ float leftVal = group.getFloat(leftCol, 0);
+ float rightVal = group.getFloat(rightCol, 0);
+ assertEquals(leftVal, rightVal, 0.0);
+ }));
+ compareColumnValues(
Review Comment:
I guess the question is: is `org.apache.parquet.example.data` supposed to be
a public API?
--
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]