wgtmac commented on code in PR #1291:
URL: https://github.com/apache/parquet-mr/pull/1291#discussion_r1513843689


##########
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'm curious too. Perhaps we can override GroupValueSource by adding `Object 
getObject(String field, int index)` which internally dispatches getXXX based on 
its GroupType? 



##########
parquet-column/src/main/java/org/apache/parquet/column/values/bytestreamsplit/ByteStreamSplitValuesReaderForFLBA.java:
##########
@@ -0,0 +1,18 @@
+package org.apache.parquet.column.values.bytestreamsplit;

Review Comment:
   License headers are missing from new files.



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

Reply via email to