Kontinuation commented on PR #2031: URL: https://github.com/apache/datafusion-comet/pull/2031#issuecomment-3079205816
> Sorry @Kontinuation if I check your references https://github.com/datafusion-contrib/fs-hdfs/blob/8c03c5ef0942b75abc79ed673931355fa9552131/c_src/libhdfs/hdfs.c#L1564C15-L1564C19 like here, it actually returns -1? When EOF was hit, `FSDataInputStream#read` returns -1. This follows the requirement of the parent class [`DataInputStream#read`](https://docs.oracle.com/javase/8/docs/api/java/io/DataInputStream.html#read-byte:A-): > *return* the total number of bytes read into the buffer, or `-1` if there is no more data because the end of the stream has been reached. The `jVal.i < 0` branch is for handling EOF in libhdfs, it returns 0: ```c if (jVal.i < 0) { // EOF destroyLocalReference(env, jbRarray); return 0; } ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org