ANTLR had a breaking change in its serialization format between 4.9 and 4.10+, meaning libraries that depend on one are incompatible with libraries that depend on another.
Spark (until Spark 4.x) depends on ANTRL 4.9, so this project bumping ANTLR 4.10+ made it impossible to use both Spark and substrait-java in the same project.
Shadowing and relocating the ANTLR dependency removes the issues with incompatibility since substrait-spark's ANTLR is now independent of any other ANTLRs.
I defer to people more expert in Gradle than me to say whether it's the optimal implementation, but it does seem to produce the correct result for me using the generated Maven artifacts. 👍
ANTLR had a breaking change in its serialization format between 4.9 and 4.10+, meaning libraries that depend on one are incompatible with libraries that depend on another.
Spark (until Spark 4.x) depends on ANTRL 4.9, so this project bumping ANTLR 4.10+ made it impossible to use both Spark and substrait-java in the same project.
Shadowing and relocating the ANTLR dependency removes the issues with incompatibility since substrait-spark's ANTLR is now independent of any other ANTLRs.