viirya commented on code in PR #5248:
URL: https://github.com/apache/arrow-rs/pull/5248#discussion_r1437210927


##########
arrow/src/ffi_stream.rs:
##########
@@ -356,12 +357,10 @@ impl Iterator for ArrowArrayStreamReader {
                 return None;
             }
 
-            let schema_ref = self.schema();
-            // NOTE: this parses the FFI_ArrowSchema again on each iterator 
call;
-            // should probably use from_ffi_and_data_type() instead.
-            let schema = FFI_ArrowSchema::try_from(schema_ref.as_ref()).ok()?;
-
-            let data = unsafe { from_ffi(array, &schema) }.ok()?;
+            let data = unsafe {
+                from_ffi_and_data_type(array, 
DataType::Struct(self.schema().fields().clone()))
+            }
+            .ok()?;

Review Comment:
   Maybe I thought that as `self.schema` is parsed from imported 
`FFI_ArrowSchema`, it should be no error to export it to `FFI_ArrowSchema` 
again? It doesn't looks quite correct and I think we should propagate the error.



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