Fix potential malformed headers in parquet delta decoder - #22275
Conversation
|
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. |
| uint32_t const prev_src_pos = s->src_pos; | ||
|
|
||
| uint32_t target_pos; | ||
| uint32_t const src_pos = s->src_pos; |
There was a problem hiding this comment.
src_pos and prev_src_pos play identical roles.
| if (batch_size > max_delta_mini_block_size) { | ||
| set_error(static_cast<kernel_error::value_type>(decode_error::DELTA_PARAMS_UNSUPPORTED), | ||
| error_code); | ||
| if (block.thread_rank() == 0) { |
There was a problem hiding this comment.
Only one thread needs to set the error
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds an ChangesDelta decoder error handling
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cpp/src/io/parquet/page_delta_decode.cu (1)
775-781: 💤 Low valueConsider using
kernel_error::value_typefor consistency with other kernels.The other delta decode kernels use
static_cast<kernel_error::value_type>(...)(e.g., lines 371, 554, 577), while this one usesstatic_cast<int32_t>(...). The code works correctly, but using the typedef ensures consistency and avoids issues if the type changes.Suggested fix
if (db->error) { if (block.thread_rank() == 0) { - set_error(static_cast<int32_t>(decode_error::DELTA_PARAMS_UNSUPPORTED), error_code); + set_error(static_cast<kernel_error::value_type>(decode_error::DELTA_PARAMS_UNSUPPORTED), error_code); } return; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@cpp/src/io/parquet/page_delta_decode.cu` around lines 775 - 781, Replace the inconsistent cast in the error path: when calling set_error(.., error_code) in the block where db->error is checked, change the static_cast<int32_t>(decode_error::DELTA_PARAMS_UNSUPPORTED) to static_cast<kernel_error::value_type>(decode_error::DELTA_PARAMS_UNSUPPORTED) so it matches other delta decode kernels (see other uses of kernel_error::value_type) and keeps type consistency for set_error, using the same symbols db->error, block.thread_rank(), set_error, decode_error::DELTA_PARAMS_UNSUPPORTED, and error_code.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@cpp/src/io/parquet/page_delta_decode.cu`:
- Around line 775-781: Replace the inconsistent cast in the error path: when
calling set_error(.., error_code) in the block where db->error is checked,
change the static_cast<int32_t>(decode_error::DELTA_PARAMS_UNSUPPORTED) to
static_cast<kernel_error::value_type>(decode_error::DELTA_PARAMS_UNSUPPORTED) so
it matches other delta decode kernels (see other uses of
kernel_error::value_type) and keeps type consistency for set_error, using the
same symbols db->error, block.thread_rank(), set_error,
decode_error::DELTA_PARAMS_UNSUPPORTED, and error_code.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 8aa79831-7a08-4539-a7ed-f2c3779e2ab2
📒 Files selected for processing (2)
cpp/src/io/parquet/delta_binary.cuhcpp/src/io/parquet/page_delta_decode.cu
| values_per_mb = block_size / mini_block_count; | ||
| error = false; | ||
|
|
||
| // Validate header against the DELTA_BINARY_PACKED spec invariants |
There was a problem hiding this comment.
Validate header here and set error field.
| if (batch_size > max_delta_mini_block_size) { | ||
| set_error(static_cast<kernel_error::value_type>(decode_error::DELTA_PARAMS_UNSUPPORTED), | ||
| error_code); | ||
| if (db->error or batch_size > max_delta_mini_block_size) { |
There was a problem hiding this comment.
Check for db->error field, propagate it and exit early.
| block.sync(); | ||
|
|
||
| // Propagate malformed-header errors from either underlying DELTA_BINARY_PACKED decoder. | ||
| if (prefix_db->error or suffix_db->error) { |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Co-authored-by: Muhammad Haseeb <14217455+mhaseeb123@users.noreply.github.com>
c2a5a33 to
c839f1b
Compare
|
/ok to test c839f1b |
|
/merge |
ttnghia
left a comment
There was a problem hiding this comment.
I would expect this increase register usage a little bit.
This PR checks for potential malformed headers in Parquet delta decoder and propagates it in decoders. Authors: - Muhammad Haseeb (https://github.com/mhaseeb123) Approvers: - Paul Mattione (https://github.com/pmattione-nvidia) - Bradley Dice (https://github.com/bdice) - Nghia Truong (https://github.com/ttnghia) URL: NVIDIA#22275
Description
This PR checks for potential malformed headers in Parquet delta decoder and propagates it in decoders.
Checklist