edponce commented on pull request #11527:
URL: https://github.com/apache/arrow/pull/11527#issuecomment-949994868


   _Note:_ The `CArrayData` of a `CRecordBatch` can still be accessed without 
`column_data()` via the `data()` method of `CArray`.
   ```python
   def get_array_data(obj):
       cdef:
           shared_ptr[CRecordBatch] record = pyarrow_unwrap_batch(obj)
           shared_ptr[CArray] array
           shared_ptr[CArrayData] data
       array = record.get().column(1)
       data = array.get().data()
       return data.get()
   ```
   but `column_data()` allows a more direct access
   ```python
   def get_array_data(obj):
       cdef:
           shared_ptr[CRecordBatch] record = pyarrow_unwrap_batch(obj)
           shared_ptr[CArrayData] data
       data = record.get().column_data(1)
       return data.get()
   ```


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