[AURON #2472] Fix nullable struct field null propagation - #2473
Open
lyne7-sc wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes incorrect null handling when extracting a child field from a nullable StructArray in the native engine: the child field now becomes null whenever the parent struct is null (matching vanilla Spark semantics), while keeping the zero-copy path when the parent struct has no nulls.
Changes:
- Combine parent struct and child field null bitmaps in
GetIndexedFieldExprusingNullBuffer::union. - Preserve zero-copy behavior by returning the child array directly when the parent struct has no nulls.
- Add coverage via a Rust unit test for parent/child null propagation and a Spark Parquet E2E query test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| native-engine/datafusion-ext-exprs/src/get_indexed_field.rs | Propagates parent struct nulls to the selected child field and adds Rust unit tests for the behavior (and zero-copy path). |
| spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala | Adds an E2E Parquet test ensuring s.child is null when s is null. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2472
Rationale for this change
Auron does not propagate the parent struct's null bitmap when accessing a child field. As a result, a field of a null struct may incorrectly return a physical value such as
0instead ofnull.What changes are included in this PR?
GetIndexedFieldExpr.Are there any user-facing changes?
Bug fix only, accessing a field of a null struct now returns null, consistent with vanilla Spark.
How was this patch tested?
Was this patch authored or co-authored using generative AI tooling?
If yes, include:
Generated-by: gpt-5.6ASF guidance: https://www.apache.org/legal/generative-tooling.html