This is an automated email from the ASF dual-hosted git repository.

lixiao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 2514163  [SPARK-26799][BUILD] Make ANTLR v4 version consistent between 
Maven and SBT
2514163 is described below

commit 2514163366feb91de665b704a6fb703855db6bee
Author: seancxmao <seancx...@gmail.com>
AuthorDate: Thu Jan 31 14:39:32 2019 -0800

    [SPARK-26799][BUILD] Make ANTLR v4 version consistent between Maven and SBT
    
    ## What changes were proposed in this pull request?
    Currently ANTLR v4 versions used by Maven and SBT are slightly different. 
Maven uses `4.7.1` while SBT uses `4.7`.
    
    * Maven(`pom.xml`): `<antlr4.version>4.7.1</antlr4.version>`
    * SBT(`project/SparkBuild.scala`): `antlr4Version in Antlr4 := "4.7"`
    
    We should make Maven and SBT use a single version. Furthermore we'd better 
specify antlr4 version in one place to avoid mismatch between Maven and SBT in 
the future.
    
    This PR lets SBT use antlr4 version specified in Maven POM file, rather 
than specify its own antlr4 version. This is in the same as how 
`hadoop.version` is specified in `project/SparkBuild.scala`
    
    ## How was this patch tested?
    Test locally.
    
    After run `sbt compile`, Java files generated by ANTLR are located at:
    
    ```
    
sql/catalyst/target/scala-2.12/src_managed/main/antlr4/org/apache/spark/sql/catalyst/parser/*.java
    ```
    
    These Java files have a comment at the head. We can see now SBT uses ANTLR 
`4.7.1`.
    
    ```
    // Generated from 
.../spark/sql/catalyst/src/main/antlr4/org/apache/spark/sql/catalyst/parser/SqlBase.g4
 by ANTLR 4.7.1
    ```
    
    Closes #23713 from seancxmao/antlr4-version-consistent.
    
    Authored-by: seancxmao <seancx...@gmail.com>
    Signed-off-by: gatorsmile <gatorsm...@gmail.com>
---
 project/SparkBuild.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 8d836da..65ba25c 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -568,7 +568,7 @@ object OldDeps {
 
 object Catalyst {
   lazy val settings = antlr4Settings ++ Seq(
-    antlr4Version in Antlr4 := "4.7",
+    antlr4Version in Antlr4 := 
SbtPomKeys.effectivePom.value.getProperties.get("antlr4.version").asInstanceOf[String],
     antlr4PackageName in Antlr4 := 
Some("org.apache.spark.sql.catalyst.parser"),
     antlr4GenListener in Antlr4 := true,
     antlr4GenVisitor in Antlr4 := true


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to