Skip to content

Conversation

@Kontinuation
Copy link
Member

Which issue does this PR close?

Closes #1844 and probably #1823.

Rationale for this change

Loading data with custom schema may produce rows containing null struct fields. Shuffling such null struct fields throws exceptions mentioned in the linked issues.

What changes are included in this PR?

Fixes appending null rows to StructBuilder by making children field builders always in sync with the parent struct builder.

How are these changes tested?

  1. Add unit tests for append_field in native code
  2. Add a Scala unit test modified from the minimal repro of the bug

@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.40%. Comparing base (f09f8af) to head (0fcd7eb).
Report is 240 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1845      +/-   ##
============================================
+ Coverage     56.12%   59.40%   +3.28%     
- Complexity      976     1151     +175     
============================================
  Files           119      130      +11     
  Lines         11743    12663     +920     
  Branches       2251     2374     +123     
============================================
+ Hits           6591     7523     +932     
+ Misses         4012     3930      -82     
- Partials       1140     1210      +70     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

#[test]
#[cfg_attr(miri, ignore)] // Unaligned memory access in SparkUnsafeRow
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to file a follow-on issue to remove the unaligned memory access?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logged #1849

Copy link
Member

@andygrove andygrove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Kontinuation

@andygrove
Copy link
Member

I confirmed that this does also close #1823

@andygrove andygrove linked an issue Jun 4, 2025 that may be closed by this pull request
@Kontinuation Kontinuation marked this pull request as ready for review June 5, 2025 00:52
@andygrove andygrove merged commit 6463153 into apache:main Jun 5, 2025
78 checks passed
coderfender pushed a commit to coderfender/datafusion-comet that referenced this pull request Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CometColumnarExchange throws exception when reading Delta table Panic in Comet shuffle when building structs

3 participants