nandorKollar commented on code in PR #3726:
URL: https://github.com/apache/avro/pull/3726#discussion_r3101051375


##########
lang/java/avro/src/test/java/org/apache/avro/TestDataFileReader.java:
##########
@@ -238,4 +245,36 @@ void invalidMagicBytes() throws IOException {
           () -> DataFileReader.openReader(fileInput, new 
GenericDatumReader<>()));
     }
   }
+
+  @Test
+  void missingSchemaMetadataDoesNotThrowNullPointerException() throws 
IOException {
+    byte[] malformedFile = buildContainerHeaderWithoutSchema();
+
+    IOException streamException = assertThrows(IOException.class,
+        () -> new DataFileStream<>(new ByteArrayInputStream(malformedFile), 
new GenericDatumReader<>()));
+    assertNotNull(streamException.getMessage());
+    
assertTrue(streamException.getMessage().contains(DataFileConstants.SCHEMA));
+
+    IOException readerException = assertThrows(IOException.class,

Review Comment:
   You mentioned DataFileReader12 in the PR (and the problem was indeed fixed 
there too), does this test case give sufficient coverage to verify those 
changes too?



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