Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.0.0
-
None
Description
In case of nested types the binary-like arrays are chunked but not the others, so after finalizing the builder the nested output array contains different length children.
char = b'x' ty = pa.binary() v1 = char * 100000000 v2 = char * 147483646 struct_type = pa.struct([ pa.field('bool', pa.bool_()), pa.field('integer', pa.int64()), pa.field('string-like', ty), ]) data = [{'bool': True, 'integer': 1, 'string-like': v1}] * 20 data.append({'bool': True, 'integer': 1, 'string-like': v2}) arr = pa.array(data, type=struct_type) assert isinstance(arr, pa.Array) data.append({'bool': True, 'integer': 1, 'string-like': char}) arr = pa.array(data, type=struct_type) assert isinstance(arr, pa.ChunkedArray)
len(arr.field(0)) == 22 len(arr.field(1)) == 22 len(arr.field(2)) == 1 # the string array gets chunked whereas the rest of the fields do not
Attachments
Issue Links
- is fixed by
-
ARROW-9992 [C++][Python] Refactor python to arrow conversions based on a reusable conversion API
- Resolved