athlcode opened a new pull request, #22100:
URL: https://github.com/apache/datafusion/pull/22100

   ## Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and 
enhancements and this helps us generate change logs for our releases. You can 
link an issue to this PR using the GitHub syntax. For example `Closes #123` 
indicates that this PR will close issue #123.
   -->
   
   - Closes #19053.
   
   ## Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in 
the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your 
changes and offer better suggestions for fixes.  
   -->
   
   DataFusion's 'unnest' had no way to express Spark 'explode_outer' semantics, 
empty input lists were silently dropped, even with 'preserve_nulls' = true.
   
   
   ## What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is 
sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   Replaces `UnnestOptions.preserve_nulls: bool` with `null_handling: 
NullHandling { Drop, Preserve, PreserveAndExpandEmpty }`, threading the new 
variant through `find_longest_length`, the proto schema (tag 1 reserved, new 
tag 3 enum), and the unparser. `with_preserve_nulls(bool)` stays as a 
backward-compat builder.
   
   
   ## Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are 
they covered by existing tests)?
   -->
   
   Yes, new snapshot unit test `test_build_batch_preserve_and_expand_empty` in 
`physical-plan`, extended `test_longest_list_length` and the 
`unnest_column_nulls` DataFrame integration test, plus existing proto 
round-trip tests cover the new field.
   
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->
   
   The `UnnestOptions.preserve_nulls` field is renamed to `null_handling` (an 
enum), but the `with_preserve_nulls(bool)` builder method is preserved, so most 
callers are unaffected. Worth the `api change` label for the field rename.
   


-- 
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]

Reply via email to