Igosuki commented on a change in pull request #1556:
URL: https://github.com/apache/arrow-datafusion/pull/1556#discussion_r784746803



##########
File path: datafusion/src/avro_to_arrow/reader.rs
##########
@@ -101,30 +100,49 @@ impl ReaderBuilder {
     }
 
     /// Create a new `Reader` from the `ReaderBuilder`
-    pub fn build<'a, R>(self, source: R) -> Result<Reader<'a, R>>
+    pub fn build<R>(self, source: R) -> Result<Reader<R>>
     where
         R: Read + Seek,
     {
         let mut source = source;
 
         // check if schema should be inferred
-        let schema = match self.schema {
-            Some(schema) => schema,
-            None => Arc::new(super::read_avro_schema_from_reader(&mut 
source)?),
-        };
         source.seek(SeekFrom::Start(0))?;
-        Reader::try_new(source, schema, self.batch_size, self.projection)
+        let (mut avro_schemas, mut schema, codec, file_marker) =
+            read::read_metadata(&mut source)?;
+        if let Some(proj) = self.projection {

Review comment:
       It can save a bit of computation and memory but not i/o obviously. 
Should we change this ?




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