Skip to content

Spark: Add support for Spark 4.1 - #14155

Merged
aokolnychyi merged 3 commits into
apache:mainfrom
manuzhang:spark4.1-preview
Dec 23, 2025
Merged

Spark: Add support for Spark 4.1#14155
aokolnychyi merged 3 commits into
apache:mainfrom
manuzhang:spark4.1-preview

Conversation

@manuzhang

Copy link
Copy Markdown
Member

No description provided.

@manuzhang

manuzhang commented Sep 23, 2025

Copy link
Copy Markdown
MemberAuthor

Created apache/spark#52423 at Spark side to fix failed tests for Spark 4.1.0-preview1.

025-09-22T16:49:13.6462602Z TestCreateActions > testAddColumnOnMigratedTableAtEnd() > catalogName = spark_catalog, implementation = org.apache.iceberg.spark.SparkSessionCatalog, config = {type=hive, default-namespace=default, parquet-enabled=true, cache-enabled=false}, type = hive FAILED
2025-09-22T16:49:13.6466422Z org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 431.0 failed 1 times, most recent failure: Lost task 0.0 in stage 431.0 (TID 3270) (localhost executor driver): java.lang.NullPointerException: Cannot invoke "org.apache.spark.sql.types.DataType.transformRecursively(scala.PartialFunction)" because "type" is null
2025-09-22T16:49:13.6469913Z at org.apache.spark.sql.vectorized.ColumnVector.<init>(ColumnVector.java:341)
2025-09-22T16:49:13.6471238Z at org.apache.iceberg.spark.data.vectorized.ConstantColumnVector.<init>(ConstantColumnVector.java:41)

dongjoon-hyun pushed a commit to apache/spark that referenced this pull request Sep 24, 2025
…ith null DataType
### What changes were proposed in this pull request?
Check whether the parameter DataType is null in ColumnVector constructor before transforming it
### Why are the changes needed?
A subclass of ColumnVector, e.g. Iceberg's [ConstantColumnVector](https://github.com/apache/iceberg/blob/main/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java#L41), could be created with null `DataType`. It throws NPE after #51349, which can be verified by failed tests in [integrating Spark 4.1.0-preview1 in Iceberg](apache/iceberg#14155)
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
UT.
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes#52423 from manuzhang/SPARK-53678.
Authored-by: manuzhang <owenzhang1990@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@manuzhangmanuzhang changed the title Spark: Add support for Spark 4.1 (4.1.0-preview1)Spark: Add support for Spark 4.1Sep 24, 2025
@manuzhang
manuzhangforce-pushed the spark4.1-preview branch 5 times, most recently from 7df730b to 030d9e8CompareSeptember 26, 2025 02:05
@manuzhang
manuzhangforce-pushed the spark4.1-preview branch 3 times, most recently from cac12c7 to ad82343CompareSeptember 30, 2025 15:08
@manuzhang
manuzhangforce-pushed the spark4.1-preview branch 3 times, most recently from c3f856b to 13d315bCompareOctober 27, 2025 09:11
@manuzhang
manuzhangforce-pushed the spark4.1-preview branch 4 times, most recently from 0e2436b to 612a72aCompareNovember 18, 2025 08:32
qualifyTableIdentifiers(
qualifyFunctionIdentifiers(
SubstituteUnresolvedOrdinals.apply(CTESubstitution.apply(plan)),
CTESubstitution.apply(plan),

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

SubstituteUnresolvedOrdinals removed and not needed after apache/spark#50606

@manuzhang
manuzhangforce-pushed the spark4.1-preview branch 2 times, most recently from 11a7ba2 to 6ef2c11CompareDecember 10, 2025 02:00
@raphaelauv

Copy link
Copy Markdown

will it be part of iceberg 1.10.1 ? ( since spark 4.1.0 was release today ) thanks

@nastra

Copy link
Copy Markdown
Contributor

will it be part of iceberg 1.10.1 ? ( since spark 4.1.0 was release today ) thanks

No this won't be part of 1.10.1 since 1.10.1 is a patch release

@pan3793

Copy link
Copy Markdown
Member

Spark 4.1.0 jars are available in Maven Central, do you guys have a plan to move this forward?

@manuzhang

Copy link
Copy Markdown
MemberAuthor

@pan3793 Since Spark 4.1.0 has known issues and Spark 4.1.1 will be released soon, we can wait for 4.1.1 RC and test again.

@aokolnychyi

aokolnychyi commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

@manuzhang, what about getting this in now? Can you update the PR to include any changes that went in while it was open?

The only open question I had was related to MERGE behavior but we are reconsidering that in 4.1.1, so we will test it separately.

@aokolnychyi

Copy link
Copy Markdown
Contributor

By the way, thanks for working on this, @manuzhang. I know it is tiring to keep updating such PRs.

@aokolnychyi

aokolnychyi commented Dec 22, 2025

Copy link
Copy Markdown
Contributor

Let's just update to the official 4.1.0, not RC. Forgot to ask.

@aokolnychyi

Copy link
Copy Markdown
Contributor

Double checked the last commit, looking good. Waiting for the tests.

@aokolnychyi
aokolnychyi merged commit 3179684 into apache:mainDec 23, 2025
47 checks passed
@aokolnychyi

Copy link
Copy Markdown
Contributor

Thanks, @manuzhang@pan3793!

@pan3793

Copy link
Copy Markdown
Member

Great, thanks for @manuzhang's work and @aokolnychyi's merging!

Sign up for freeto 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.

5 participants

@manuzhang@aokolnychyi@pan3793@raphaelauv@nastra