cnauroth commented on code in PR #7291:
URL: https://github.com/apache/hadoop/pull/7291#discussion_r1920495312
##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/shell/TestTextCommand.java:
##########
@@ -67,39 +75,194 @@ public void testDisplayForAvroFiles() throws Exception {
assertEquals(expectedOutput, output);
}
+ @Test
+ public void testEmptyAvroFile() throws Exception {
Review Comment:
I'm unclear about bringing this into a contract test. These tests are
covering semantics very specific to `hadoop fs -text`. The expectation is that
the command can decode Avro and sequence files and print them in JSON/text
representation. At the `FileSystem` layer, it would just be returning the raw
bytes. Existing contract tests cover "input bytes == output bytes". If
hdfs/s3a/azure/gcs get that part right, then the `hadoop fs -text` behavior
falls into place regardless of the FS.
However, maybe something we can do is expand contract coverage of reads in a
more generic way. For example, we could cover things like the bad argument
checks and "same data returned from read() vs. read(byte[]...)` during
`AbstractContractOpenTest`. Maybe some updates to the `FSDataInputStream`
specification docs too.
I'd recommend driving all this in a separate patch though.
--
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]