Skip to content

Conversation

vrozov
Copy link
Member

@vrozov vrozov commented Sep 30, 2025

What changes were proposed in this pull request?

Shade org.antlr:antlr4-runtime.

Why are the changes needed?

antlr4-runtime library 4.10+ is not semver compatible with 4.9: "Mixing ANTLR 4.9.3 and 4.10 can lead to errors that point to a version mismatch. A very common Java error looks like this: Caused by: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).". As ANTLR 4 is a commonly used library (for example it is used by Hive 3.x and 4.x) and many others 3rd party libraries , shading antlr4-runtime allows to avoid such conflicts.

Does this PR introduce any user-facing change?

Yes, antlr4-runtime-4.13.1.jar will be removed from Spark binary distribution. Applications that rely on ANTLR 4 will need to provide their own version.

How was this patch tested?

Using existing tests

Was this patch authored or co-authored using generative AI tooling?

No

<module>mllib-local</module>
<module>tools</module>
<module>streaming</module>
<module>sql/parser</module>
Copy link
Member Author

Choose a reason for hiding this comment

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

Introduced new module and moved .g4 files to the new module where antlr4-runtime is shaded. sql-api and other modules that use antlr4 will now depend on the new module. This avoids apache/maven-shade-plugin#345.

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.

1 participant