Repository navigation
Add DELTA_LENGTH_BYTE_ARRAY encoder and decoder for Parquet - #14590
Conversation
|
Unlike past PRs, in this PR I've done both the encoder and decoder. One reason is that the changes here are smaller than in previous delta work. A better reason is that by adding both, I can test the reader and writer at the same time without having to rely on python tests. That said, this PR does expand the existing python tests anyway...perhaps too much. Reviewers, please let me know if the delta tests in A note on the encoding itself. DELTA_LENGTH_BYTE_ARRAY is much like PLAIN encoding for strings. The difference is that the lengths are encoded first, and then the string data. The theory is that separating the two will lead to better compression. The other difference is that the lengths are DELTA_BINARY_PACKED encoded, so there should be a space savings. Because the string data is in one big chunk per page, the processing is much simpler than with DELTA_BYTE_ARRAY or even PLAIN. On the decode side, all we need to do is decode the length data into the offsets child column, and then do an exclusive scan on this to turn lengths into offsets. The character data can just be parallel memcpy'd straight into the chars child column. On the encoding side, it's a similar story. First encode the length data, and then memcpy the chars data into the page buffer. Of course, skip_rows complicates things some, but not too much. |
|
/ok to test |
Co-authored-by: Vukasin Milovanovic <[email protected]>
|
/ok to test |
|
/ok to test |
| @pytest.mark.parametrize("add_nulls", [True, False]) | ||
| @pytest.mark.parametrize("str_encoding", ["DELTA_BYTE_ARRAY"]) | ||
| def test_delta_byte_array_roundtrip(nrows, add_nulls, str_encoding, tmpdir): | ||
| @pytest.mark.parametrize("string_len", [12, 48, 96, 128]) |
There was a problem hiding this comment.
Since this parameter is used for max_string_length below, would suggest keep the name consistent here.
|
/ok to test |
|
/merge |
…bricks] (#15852) **JaCoCo production line coverage: +0 lines** (measured: `delta-lake`, `shuffle-plugin`, `sql-plugin`, `udf-compiler`; shim 350, vs nightly b19; `delta-lake` report group is stub-only; Iceberg implementation not loaded/applicable) Contributes to NVIDIA/cudf#13501. ### Description Five Parquet V2 encoding fixtures remained xfailed after cuDF added the corresponding reader support in NVIDIA/cudf#13637, NVIDIA/cudf#14101, and NVIDIA/cudf#14590. The resolved cudf-spark JNI artifact embeds cuDF revision `c2c4e85881a52e93e042a59cf88b7633147760c2`, which contains all three fixes. This change removes only those five fixture entries from `_xfail_files`. The existing `test_parquet_testing_valid_files` test continues to compare CPU and GPU results under both native and Java reader configurations, recovering 10 test nodes. Other issue-linked xfails in the shared mapping are unchanged. Validation: - Spark 3.5 distribution and integration-test build: all 16 reactor modules succeeded; `BUILD SUCCESS`. - Forced pre-edit unmasked run of the five fixtures: `10 passed, 86 deselected, 12 warnings in 7.90s`. - Focused post-edit run without `--runxfail`: `10 passed, 86 deselected, 12 warnings in 8.91s`. - Complete `parquet_testing_test.py`: `84 passed, 4 xfailed, 8 xpassed, 90 warnings in 36.49s`. - All 10 recovered JUnit nodes passed; the plans contained 30 `GpuFileGpuScan` occurrences and no CPU-fallback markers. - Post-edit exemption scan: zero NVIDIA/cudf#13501 matches; the five parameter cases are recovered while unrelated shared-map trackers remain. AI assistance: The change was prepared with Codex assistance and reviewed by the author at commit `ab12239d371d07abdd300422230a81b3eebec0ca` before submission. The PR description was prepared with Codex assistance. ### Checklists Documentation - [ ] Updated for new or modified user-facing features or behaviors - [x] No user-facing change Testing - [x] Added or modified tests to cover new code paths - [ ] Covered by existing tests (Please provide the names of the existing tests in the PR description.) - [ ] Not required Performance - [ ] Tests ran and results are added in the PR description - [ ] Issue filed with a link in the PR description - [x] Not required --------- Signed-off-by: Allen Xu <[email protected]>
Description
Part of #13501. This adds the ability to read and write Parquet pages with DELTA_LENGTH_BYTE_ARRAY encoding.
Checklist