Skip to content

Conversation

AnudeepKonaboina
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.

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

Signed-off-by: Anudeep Konaboina <[email protected]>
Signed-off-by: AnudeepKonaboina <[email protected]>
@AnudeepKonaboina AnudeepKonaboina force-pushed the fix/spark-3.5-staticinvoke branch from bcb1d98 to dea2320 Compare October 17, 2025 05:07
@AnudeepKonaboina
Copy link
Author

AnudeepKonaboina commented Oct 17, 2025

@pomadchin ! This is the new PR with ECA signed .. the old one #631 is closed as the PR was raised from a different account.Also this was tested by a couple of users and it worked without throwing the NoSuchMethod Error

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.

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

1 participant