alamb commented on code in PR #9534:
URL: https://github.com/apache/arrow-rs/pull/9534#discussion_r2917363934
##########
arrow-avro/src/reader/async_reader/mod.rs:
##########
@@ -1538,6 +1571,87 @@ mod tests {
assert!(err.to_string().contains("Duplicate projection index"));
}
+ #[tokio::test]
+ async fn test_arrow_schema_from_reader_no_reader_schema() {
+ // Use a very small header size hint to force multiple fetches
Review Comment:
these comments seem out of date
##########
arrow-avro/src/reader/async_reader/mod.rs:
##########
@@ -1538,6 +1571,87 @@ mod tests {
assert!(err.to_string().contains("Duplicate projection index"));
}
+ #[tokio::test]
+ async fn test_arrow_schema_from_reader_no_reader_schema() {
+ // Use a very small header size hint to force multiple fetches
+ let file = arrow_test_data("avro/alltypes_plain.avro");
+ let store: Arc<dyn ObjectStore> = Arc::new(LocalFileSystem::new());
+ let location = Path::from_filesystem_path(&file).unwrap();
+ let file_size = store.head(&location).await.unwrap().size;
+
+ let file_reader = AvroObjectReader::new(store, location);
Review Comment:
Could you also reduce some of the duplication in this test so that it is
easier to understand what is actually being tested and what is different
between the tests?
##########
arrow-avro/src/reader/async_reader/mod.rs:
##########
@@ -1538,6 +1571,87 @@ mod tests {
assert!(err.to_string().contains("Duplicate projection index"));
}
+ #[tokio::test]
+ async fn test_arrow_schema_from_reader_no_reader_schema() {
+ // Use a very small header size hint to force multiple fetches
+ let file = arrow_test_data("avro/alltypes_plain.avro");
+ let store: Arc<dyn ObjectStore> = Arc::new(LocalFileSystem::new());
+ let location = Path::from_filesystem_path(&file).unwrap();
+ let file_size = store.head(&location).await.unwrap().size;
+
+ let file_reader = AvroObjectReader::new(store, location);
+ let expected_schema = get_alltypes_schema()
+ .as_ref()
+ .clone()
+ .with_metadata(Default::default());
+
+ let reader = AsyncAvroFileReader::builder(file_reader, file_size, 1024)
+ .try_build()
+ .await
+ .unwrap();
+
+ assert_eq!(reader.schema().as_ref(), &expected_schema);
+
+ let batches: Vec<RecordBatch> = reader.try_collect().await.unwrap();
+ let batch = &batches[0];
+
+ assert_eq!(batch.schema().as_ref(), &expected_schema);
+ }
+
+ #[tokio::test]
+ async fn test_arrow_schema_from_reader_with_reader_schema() {
+ // Use a very small header size hint to force multiple fetches
Review Comment:
likewise this comment seems outdated
--
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]