Jefffrey commented on issue #18350:
URL: https://github.com/apache/datafusion/issues/18350#issuecomment-3477413703

   > [@alamb](https://github.com/alamb) could you chime in whether the 
implementation is in the spirit of the spec? As far as I understood the spec, 
size should be possible to be a signed integer, no?
   
   I think the spec allows signed integer for compatibility with Java (which 
doesn't have an unsigned integer type). Indeed if I try a negative size on 
pyarrow it sees the resultant array as invalid:
   
   ```python
   >>> import pyarrow as pa
   >>> pa.__version__
   '22.0.0'
   >>> values = pa.array([1, 2, 3, 4])
   >>> offsets = pa.array([0, 1, 2])
   >>> sizes = pa.array([2, 2, -2])
   >>> pa.ListViewArray.from_arrays(offsets, sizes, values)
   <pyarrow.lib.ListViewArray object at 0x1023caa40>
   [
     [
       1,
       2
     ],
     [
       2,
       3
     ],
   <Invalid array: Array length is negative>
   ]
   ```
   
   So I don't think it'll be as simple as negating the size.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to