jayzhan211 commented on PR #9595:
URL: 
https://github.com/apache/arrow-datafusion/pull/9595#issuecomment-2007069492

   > > what is the reason to return with reference? I think it is fine if 
unavoidable.
   > 
   > We primarily use `Option<OwnedTableReference>` and `Field` in functions 
whose names start with `qualified_field_*.` These functions are designed to 
locate a qualified field within a `DFSchema`. Consequently, we return a 
`(Option<&OwnedTableReference>, &Field)`, which are references to the original 
`DFSchema`. If we were to return `DFField`, it would result in data cloning.
   > 
   > ```rust
   > pub struct DFField {
   >     /// Optional qualifier (usually a table or relation name)
   >     qualifier: Option<OwnedTableReference>,
   >     /// Arrow field definition
   >     field: FieldRef, 
   > }
   > ```
   
   I see. I would prefer struct, easier to implement functions for it.


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