ReubenM opened a new issue, #43240:
URL: https://github.com/apache/arrow/issues/43240

   ### Describe the enhancement requested
   
   I'm working with large byte objects from stdin and would like an efficient 
(without intermediate copying) way to cast to pyarrow objects from sub-chunks 
of the byte objects. I can't seem to cast pyarrow directly from ranges within a 
bytes object or from ctype pointers to the byte range. But I'm not very 
familiar with pyarrow, so perhaps there is a way I've missed in documentation 
or just don't have a good understanding of the API yet.
   
   For example:
   ```
   >>> import pyarrow as pa
   
   >>> from ctypes import *
   
   >>> pa.scalar( cast( b'\xaa\xbb\xcc\xdd', POINTER( c_uint32 )).contents, 
type = pa.uint32() )
   Traceback (most recent call last):
     File "<input>", line 1, in <module>
       pa.scalar( cast( b'\xaa\xbb\xcc\xdd', POINTER( c_uint32 )).contents, 
type = pa.uint32() )
     File "pyarrow/scalar.pxi", line 1212, in pyarrow.lib.scalar
     File "pyarrow/error.pxi", line 154, in 
pyarrow.lib.pyarrow_internal_check_status
     File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
   pyarrow.lib.ArrowInvalid: Could not convert c_uint(3721182122) with type 
c_uint: tried to convert to uint32
   ```
   
   ### Component(s)
   
   Python


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