Kontinuation commented on code in PR #2031: URL: https://github.com/apache/datafusion-comet/pull/2031#discussion_r2210729874
########## native/hdfs/src/object_store/hdfs.rs: ########## @@ -141,13 +140,15 @@ impl ObjectStore for HadoopFileSystem { let file_status = file.get_file_status().map_err(to_error)?; let to_read = file_status.len(); + let mut total_read = 0u64; let mut buf = vec![0; to_read]; - let read = file.read(buf.as_mut_slice()).map_err(to_error)?; - assert_eq!( - to_read as i32, read, - "Read path {} with expected size {} and actual size {}", - &location, to_read, read - ); + while total_read < to_read as u64 { + let read = file.read(buf.as_mut_slice()).map_err(to_error)?; + if read == -1 { + break; + } Review Comment: This is also problematic. `read` also return 0 when hitting EOF and never return an negative value. -- 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