Skip to content

Conversation

@anudeepkonaboina-db
Copy link

Problem:

Spark 3.5 changed org.apache.spark.sql.catalyst.expressions.objects.StaticInvoke constructor shape, breaking reflective construction used by encoders.

Solution:

Build StaticInvoke reflectively by selecting the max-arity constructor (8/9 args) and trying both target class and companion module (static forwarder) for apply. Fallback to NewInstance when no static forwarder matches arity. Compatible with Spark 3.4 and 3.5.

Added:

ManualTypedEncoderSpec ensuring case-class decoding via static apply works through ManualTypedEncoder.staticInvoke.

Fixes: #630.

@pomadchin pomadchin added the enhancement New feature or request label Oct 16, 2025
@pomadchin
Copy link
Member

pomadchin commented Oct 16, 2025

Thx for the contribution! We'll take a look once have sometime.

Could you also sign ECA please to make Eclipse license checker happy?

@anudeepkonaboina-db anudeepkonaboina-db force-pushed the fix/spark-3.5-staticinvoke branch from feba794 to 5054956 Compare October 16, 2025 16:32
@anudeepkonaboina-db
Copy link
Author

Done @pomadchin !

…; deterministic + arg types; fallback to constructor. Add test.

Signed-off-by: anudeepkonaboina-db <[email protected]>
Signed-off-by: AnudeepKonaboina <[email protected]>
@anudeepkonaboina-db anudeepkonaboina-db force-pushed the fix/spark-3.5-staticinvoke branch from 5054956 to ccb41f8 Compare October 17, 2025 03:42
@anudeepkonaboina-db
Copy link
Author

Hey @pomadchin! I'm sorry. I created a PR with the wrong account. I have created a new one with teh right account. Sorry for the confusion.

New PR: #632

@anudeepkonaboina-db
Copy link
Author

closing this PR

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Spark 3.5: Catalyst StaticInvoke constructor signature changed (8-arg vs 9-arg with Option)

3 participants