[POC] Add BINARY type to cuDF supporting 32-bit and 64-bit offsets - #23658
Draft
GregoryKimball wants to merge 12 commits into
Draft
[POC] Add BINARY type to cuDF supporting 32-bit and 64-bit offsets#23658GregoryKimball wants to merge 12 commits into
GregoryKimball wants to merge 12 commits into
Conversation
Define the byte-oriented row view, variable-width column view, and factories with INT32 or INT64 offsets. Register the new sources and permit BINARY parent payload storage.
Map BINARY to binary_view, enable device element access, and add explicit support boundaries for APIs that still depend on deferred scalar or variable-width implementations.
Cover dispatcher and trait mappings, both offset widths, canonical empty layout, unsigned-byte ordering, factory validation, and device row access.
Copy sliced BINARY columns with normalized offsets, preserved offset width, payload bytes, and validity so generic column copy construction handles the new type.
Add a device-view factory and use it to move variable-width binary rows through generic gather and concatenate paths, including sliced and out-of-bounds inputs.
Materialize target binary views, scatter source rows into them, and rebuild the variable-width output while preserving empty and null values.
Hash binary payload bytes across MurmurHash and xxHash implementations, and verify unsigned-byte ordering and equality through sort and distinct operations.
Exercise dictionary encode and decode with duplicate and empty binary payloads to establish support through generic hash, sort, gather, and comparison paths.
Add a per-column byte-array output policy, default unannotated BYTE_ARRAY and fixed-length data to BINARY, preserve annotated text as STRING, and retain the legacy LIST<UINT8> compatibility path.
Encode native BINARY payloads through Parquet byte-array paths, including dictionary encoding and statistics, so BINARY columns round-trip without conversion.
Emit Arrow BinaryView metadata for native BINARY columns so Arrow-schema-enabled Parquet round trips retain byte semantics.
Honor type-length metadata for native BINARY columns and encode their payloads as FIXED_LEN_BYTE_ARRAY values with round-trip coverage.
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Many data processing workloads carry binary data as payloads. cuDF has represented this data using a physical type of
LIST<UNIT8>, but this representation often hits the limit of 2.1 GB per column due to thesize_typelimit on list children. If cuDF had aBINARYtype, we could naturally represent these kind of payloads, and with the offsetalator pattern fromSTRINGSwe could also supportLARGE_BINARYarrow data using 64-bit offsets.Adding a
BINARYtype to cuDF brings several benefits:STRUCT<LIST<UNIT8>,LIST<UINT8>>and this could change toSTRUCT<BINARY,BINARY>.STRINGorLIST<UINT8>. A native binary type would be a more natural target type.BINARYtype could also let users convert and carry lists of fixed width type, likeLIST<FLOAT32>embeddings beyond the 32-bit child limit.Why haven't we added
BINARYyet?LIST<UINT8>has been an adequate workaroundWhat is this POC for?
libcudf.sobinary size impact of adding a typeChecklist