You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/10/30 11:28:33 UTC

[GitHub] [arrow-datafusion] Igosuki opened a new pull request #1206: improve avro reader performance by avoid some cloning on avro_rs::Value

Igosuki opened a new pull request #1206:
URL: https://github.com/apache/arrow-datafusion/pull/1206


   # Which issue does this PR close?
   
   Closes #1205
   
    # Rationale for this change
   Avro reader performance is quite bad.
   
   # What changes are included in this PR?
   Avoids cloning avro data values.
   
   # Are there any user-facing changes?
   No
   
   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Igosuki commented on a change in pull request #1206: Improve avro reader performance by avoiding some cloning on avro_rs::Value

Posted by GitBox <gi...@apache.org>.
Igosuki commented on a change in pull request #1206:
URL: https://github.com/apache/arrow-datafusion/pull/1206#discussion_r739784948



##########
File path: datafusion/src/avro_to_arrow/arrow_array_reader.rs
##########
@@ -112,6 +112,7 @@ impl<'a, R: Read> AvroArrowArrayReader<'a, R> {
             // reached end of file
             return Ok(None);
         }
+        let rows = rows.iter().collect::<Vec<&Vec<(String, Value)>>>();

Review comment:
       Unfortunately, in both cases we have to take ownership of the values from the iterator first. 
   I couldn't find a way to do otherwise... 




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #1206: Improve avro reader performance by avoiding some cloning on avro_rs::Value

Posted by GitBox <gi...@apache.org>.
Dandandan commented on a change in pull request #1206:
URL: https://github.com/apache/arrow-datafusion/pull/1206#discussion_r739650615



##########
File path: datafusion/src/avro_to_arrow/arrow_array_reader.rs
##########
@@ -112,6 +112,7 @@ impl<'a, R: Read> AvroArrowArrayReader<'a, R> {
             // reached end of file
             return Ok(None);
         }
+        let rows = rows.iter().collect::<Vec<&Vec<(String, Value)>>>();

Review comment:
       Can we reduce this to one iteration by doing something in the loop above (`self.reader.by_ref().take(batch_size).map(|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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on a change in pull request #1206: Improve avro reader performance by avoiding some cloning on avro_rs::Value

Posted by GitBox <gi...@apache.org>.
Dandandan commented on a change in pull request #1206:
URL: https://github.com/apache/arrow-datafusion/pull/1206#discussion_r739650835



##########
File path: datafusion/src/avro_to_arrow/arrow_array_reader.rs
##########
@@ -561,6 +562,7 @@ impl<'a, R: Read> AvroArrowArrayReader<'a, R> {
                         }
                     })
                     .collect();
+                let rows = rows.iter().collect::<Vec<&Vec<(String, Value)>>>();

Review comment:
       Maybe we can produce a `&Vec` above already to avoid recreating the `Vec`?




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan commented on pull request #1206: Improve avro reader performance by avoiding some cloning on avro_rs::Value

Posted by GitBox <gi...@apache.org>.
Dandandan commented on pull request #1206:
URL: https://github.com/apache/arrow-datafusion/pull/1206#issuecomment-961107905


   Thanks @Igosuki 


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [arrow-datafusion] Dandandan merged pull request #1206: Improve avro reader performance by avoiding some cloning on avro_rs::Value

Posted by GitBox <gi...@apache.org>.
Dandandan merged pull request #1206:
URL: https://github.com/apache/arrow-datafusion/pull/1206


   


-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org