Skip to content

create Spark 4.1 and 4.2 support and fix unit tests - #966

Open
ukby1234 wants to merge 3 commits into
typelevel:masterfrom
ukby1234:spark-4-support
Open

create Spark 4.1 and 4.2 support and fix unit tests#966
ukby1234 wants to merge 3 commits into
typelevel:masterfrom
ukby1234:spark-4-support

Conversation

@ukby1234

Copy link
Copy Markdown

Created support for Spark 4.1 and Spark 4.2.
One unit tests failed because the generated analyzed plan fails the validation. This is the same plan generated for Spark 3.5 as well. Spark introduced a feature to reconcile schema for different datasets, and changed the unit to address the column-ordering issue.
Also tested with a locally published version against https://github.com/scalapb/sparksql-scalapb, and all tests there are passing as well.

@ukby1234

Copy link
Copy Markdown
Author

@pomadchin can i get a review from the maintainer? thanks.

@pomadchin

pomadchin commented Jul 29, 2026

Copy link
Copy Markdown
Member

@ukby1234 ty for the PR! Also that's your first contribution! 🎉

One unit tests failed because the generated analyzed plan fails the validation

What tests did fail? 👀

@pomadchin pomadchin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, could I ask to update REAMDE.md as well if possible?
Will merge once the question about the test is cleared.

@ukby1234

Copy link
Copy Markdown
Author

LGTM, could I ask to update REAMDE.md as well if possible? Will merge once the question about the test is cleared.

You mean update the supported versions?

@pomadchin

Copy link
Copy Markdown
Member

LGTM, could I ask to update REAMDE.md as well if possible? Will merge once the question about the test is cleared.

You mean update the supported versions?

yes!

@ukby1234

Copy link
Copy Markdown
Author

Ok the test failed because analyzer.checkAnalysis failed. The dummyPlan generated above uses GetColumnByOrdinal but the analyzed plan uses GetStructField. In Spark 3 and Spark 4, both versions generated analyzedPlan like getting struct field a.a.a where a.a is a double type. In theory, it should generate b.a.a.
In Spark 4.1+, they added data type check for GetStructField, which resulted in data type mismatch. I don't think it's a regression since Spark 4.1+ because the generated plan never works as intended, and folks with DataFrame columns out of order should use Spark's native .to(schema) feature to reorder the columns.
@pomadchin

@ukby1234

Copy link
Copy Markdown
Author

Will update the README.md to update the supported versions. @pomadchin

@ukby1234

Copy link
Copy Markdown
Author

ok updated README.md @pomadchin

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.23%. Comparing base (bc1a19f) to head (d99c075).
⚠️ Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #966      +/-   ##
==========================================
+ Coverage   96.21%   96.23%   +0.01%     
==========================================
  Files          66       68       +2     
  Lines        1296     1328      +32     
  Branches       48       48              
==========================================
+ Hits         1247     1278      +31     
- Misses         49       50       +1     
Flag Coverage Δ
2.13-root-spark35 96.26% <ø> (?)
2.13-root-spark40 ?
2.13-root-spark41 96.21% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants