Skip to content

[Hive 4 / Spark 4.2] Fix PartitionFilter ANTLR4 incompatibility with Spark 4.2 - #6985

Open
Aggarwal-Raghav wants to merge 2 commits into
apache:masterfrom
Aggarwal-Raghav:HIVE-30279
Open

Aggarwal-Raghav wants to merge 2 commits into
apache:masterfrom
Aggarwal-Raghav:HIVE-30279

Conversation

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

HIVE-30279, Upgrade antlr to 4.13.1

Why are the changes needed?

Internally, we are chasing spark4.2 to build with Hive4.2.1 instead of Hive2.3.10 which is used by opensource spark.
Spark observed incompatibility as antlr4.9 and 4.10 onwards is not compatible as per antlr release notes and spark 4.2 is using antlr-4.13.1

https://github.com/antlr/antlr4/releases/tag/4.10 under section 4.10-generated parsers incompatible with previous runtimes

Does this PR introduce any user-facing change?

NO

How was this patch tested?

Will see CI outcome

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor Author

flaky jenkins behaviour observed. github actions and local build is working

11:47:33  [INFO] --- antlr4:4.13.1:antlr4 (default) @ hive-standalone-metastore-server ---
11:47:33  [WARNING] The POM for org.antlr:antlr4-maven-plugin:jar:4.13.1 is missing, no dependency information available
11:47:33  [WARNING] Error injecting: org.antlr.mojo.antlr4.Antlr4Mojo
11:47:33  java.lang.NoClassDefFoundError: org/antlr/v4/Tool

@deniskuzZ deniskuzZ 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.

+1

@dengzhhu653

Copy link
Copy Markdown
Member

I don't get it, the PartitionFilter will parse the expression on the server side, how it will impact the client such as Spark?

@Aggarwal-Raghav

Copy link
Copy Markdown
Contributor Author

I don't get it, the PartitionFilter will parse the expression on the server side, how it will impact the client such as Spark?

You are correct @dengzhhu653 , when HMS is running in remote/cluster mode, issue is not observed.

The failure occured in embedded metastore used in Spark UT.

<maven.surefire.plugin.version>3.5.3</maven.surefire.plugin.version>
<!-- Dependency versions -->
<antlr.version>4.9.3</antlr.version>
<antlr.version>4.13.1</antlr.version>

@dengzhhu653 dengzhhu653 Dec 1, 2026 •

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.

How about shading the antlr classes? so it's compatible for other old clients

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yeah, make sense. thx, will update PR shortly

@sonarqubecloud

sonarqubecloud Bot commented Dec 1, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

4 participants