comphead commented on code in PR #7718:
URL: https://github.com/apache/datafusion-comet/pull/7718#discussion_r4743960934
##########
native/core/src/parquet/parquet_support.rs:
##########
@@ -385,26 +386,33 @@ fn parquet_convert_array_impl(
// keeps the dictionary, succeeds (#7254).
(Dictionary(_, value_type), Utf8) if matches!(value_type.as_ref(),
Binary | LargeBinary) => {
let dictionary = array.as_any_dictionary();
- let keys = dictionary.normalized_keys();
- let key_nulls = dictionary.keys().nulls();
+ // An all-null batch can have no dictionary entries.
+ if dictionary.values().is_empty() {
+ return Ok((new_null_array(to_type, array.len()), true));
+ }
Review Comment:
This guard is the crash fix the description marks as a backport candidate
for `branch-1.2`. It lives in the same arm as the
`referenced_dictionary_values` signature change and the `take` error mapping,
and the PR also changes top-level routing in `schema_adapter.rs` and adds a
size precheck to `cast_binary_to_string`.
`docs/source/contributor-guide/backporting.md` says a patch release takes bug
fixes and that a refactor or performance change needs its own justification on
a shipped branch. Backporting this PR whole would also turn released top-level
`LargeBinary` and dictionary reads from NULL into decoded strings or an offset
error. Consider landing the guard and
`nested_all_null_binary_dictionary_reads_as_string` as a separate small PR, so
the `git cherry-pick -x` for `branch-1.2` carries only the fix.
--
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]