sunchao opened a new pull request, #7808: URL: https://github.com/apache/datafusion-comet/pull/7808
## Which issue does this PR close? This fixes the empty dictionary panic [reported during review of #7718](https://github.com/apache/datafusion-comet/pull/7718#discussion_r4703069454). It affects the nested conversion introduced by #7106 for #7032. ## Rationale for this change A Parquet struct can have a binary dictionary child with null keys and no entries. Reading that child as a string calls Arrow's `normalized_keys()`, which asserts that the dictionary has at least one entry. The read panics even though all the field values are null. The affected code is in [Comet 1.2.0](https://github.com/apache/datafusion-comet/blob/1.2.0/native/core/src/parquet/parquet_support.rs#L377-L384). This PR isolates the crash fix for a `branch-1.2` backport, as [requested on #7718](https://github.com/apache/datafusion-comet/pull/7718#discussion_r4743960934). The top-level decoding and allocation changes are in #7718. ## What changes are included in this PR? Return a null string array of the input length when a binary dictionary has no entries. Mark the field present so each parent struct retains its validity. ## How are these changes tested? `nested_all_null_binary_dictionary_reads_as_string` writes three present structs with a null `Dictionary(Int32, Binary)` child and reads them back through the Parquet scan with the child requested as a string. It checks that the three structs are present and all three string fields are null. Hosted CI runs the regression. -- 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]
