Skip to content

[SPARK-27250][test-maven][BUILD] Scala 2.11 maven compile should target Java 1.8 #24184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

jzhuge
Copy link
Member

@jzhuge jzhuge commented Mar 22, 2019

What changes were proposed in this pull request?

Fix Scala 2.11 maven build issue after merging SPARK-26946.

How was this patch tested?

Maven Scala 2.11 and 2.12 builds with -Phadoop-provided -Phadoop-2.7 -Pyarn -Phive -Phive-thriftserver.

jzhuge referenced this pull request Mar 22, 2019
## What changes were proposed in this pull request?

- Support N-part identifier in SQL
- N-part identifier extractor in Analyzer

## How was this patch tested?

- A new unit test suite ResolveMultipartRelationSuite
- CatalogLoadingSuite

rblue cloud-fan mccheah

Closes #23848 from jzhuge/SPARK-26946.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@cloud-fan
Copy link
Contributor

ok to test

@cloud-fan
Copy link
Contributor

add to whitelist

@SparkQA
Copy link

SparkQA commented Mar 22, 2019

Test build #103836 has finished for PR 24184 at commit 284ad6a.

  • This patch fails to build.
  • This patch merges cleanly.
  • This patch adds no public classes.

@jzhuge
Copy link
Member Author

jzhuge commented Mar 22, 2019

build failure:
[error] 'jvm-1.8.0_191' is not a valid choice for '-target'
[error] 'jvm-1.8.0_191' is not a valid choice for '-target'
[error] bad option: '-target:jvm-1.8.0_191'
[error] bad option: '-target:jvm-1.8.0_191'

@cloud-fan
Copy link
Contributor

shall we just use jvm-1.8?

@jzhuge
Copy link
Member Author

jzhuge commented Mar 22, 2019 via email

@vanzin
Copy link
Contributor

vanzin commented Mar 22, 2019

"java.version" is a system property set by the JVM itself.

@jzhuge
Copy link
Member Author

jzhuge commented Mar 23, 2019 via email

@jzhuge
Copy link
Member Author

jzhuge commented Mar 23, 2019 via email

@HyukjinKwon
Copy link
Member

HyukjinKwon commented Mar 23, 2019

So, is the issue java.version is not respected from root pom? If so can we investigate the root cause?

@HyukjinKwon
Copy link
Member

I have observed (I assume) this issue which caused an error in the thirdparty library I worked on but just decided to workaround within the thirdparty project. It would be awesome if root cause is identified and fixed.

@HyukjinKwon
Copy link
Member

BTW, let's do maven build as well before getting this in since we now observed the difference between SBT and Maven. If we can fix it in both SBT and Maven without identifying root cause (if that's difficult), that's fine to me too.

@srowen
Copy link
Member

srowen commented Mar 23, 2019

This is a change to the Maven build, not SBT. java.version is defined in pom.xml so I'm surprised. Is this failing when SBT interprets the pom via a plugin and uses the JVM java.version? Well, I think hard-coding "1.8" is fine for now, myself. I'm about to drop 2.11 support anyway and can remove it.

Copy link
Member

@felixcheung felixcheung left a comment

Choose a reason for hiding this comment

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

SGTM but need to update and re-run test

@jzhuge
Copy link
Member Author

jzhuge commented Mar 23, 2019

Passed maven 2.11/2.12 and sbt 2.11/2.12 builds locally, after reverting SPARK-25196.

@HyukjinKwon HyukjinKwon changed the title [SPARK-27250][BUILD] Scala 2.11 maven compile should target Java 1.8 [SPARK-27250][test-maven][BUILD] Scala 2.11 maven compile should target Java 1.8 Mar 23, 2019
@HyukjinKwon
Copy link
Member

retest this please

@SparkQA
Copy link

SparkQA commented Mar 23, 2019

Test build #4656 has started for PR 24184 at commit 28aa9cb.

@SparkQA
Copy link

SparkQA commented Mar 23, 2019

Test build #103842 has finished for PR 24184 at commit 28aa9cb.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@srowen srowen left a comment

Choose a reason for hiding this comment

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

I'll merge it fairly soon to get the 2.11 build healthy one last time

@jzhuge
Copy link
Member Author

jzhuge commented Mar 24, 2019

Thanks @srowen.

FWIW, I understand the SBT mystery a little better. Scale compile options come from maven scala-maven-plugin.configuration.args and the following code in SparkBuild.scala:

    scalacOptions in Compile ++= Seq(
      s"-target:jvm-${javaVersion.value}",
      "-sourcepath", (baseDirectory in ThisBuild).value.getAbsolutePath  // Required for relative source links in scaladoc
    ),

Evidence in the generated file inc_compile-2.12:

compile options:
12 items
00 -> -unchecked
01 -> -deprecation
02 -> -feature
03 -> -explaintypes
04 -> -Yno-adapted-args
05 -> -target:jvm-1.8.0_181
06 -> -P:genjavadoc:out=/Users/jzhuge/Repos/upstream-spark/common/network-yarn/target/java
07 -> -P:genjavadoc:strictVisibility=true
08 -> -Xplugin:/Users/jzhuge/.ivy2/cache/com.typesafe.genjavadoc/genjavadoc-plugin_2.12.8/jars/genjavadoc-plugin_2.12.8-0.11.jar
09 -> -target:jvm-1.8
10 -> -sourcepath
11 -> /Users/jzhuge/Repos/upstream-spark

The line -target:jvm-${java.version} in maven scalac args was parsed as -target:jvm-1.8.0_191, based on JVM system property, while the SparkBuild code set -target:jvm correctly because it got javaVersion from effective pom. It seems maven property java.version was not honored when extracting maven scalec options.

@seancxmao Any insight?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM, too.
After 01e6305 , I rebased this PR to the master and was able to build with Scala-2.11 on both maven/sbt cleanly.

@srowen
Copy link
Member

srowen commented Mar 24, 2019

Merged to master

mccheah pushed a commit to palantir/spark that referenced this pull request May 15, 2019
…et Java 1.8

## What changes were proposed in this pull request?

Fix Scala 2.11 maven build issue after merging SPARK-26946.

## How was this patch tested?

Maven Scala 2.11 and 2.12 builds with `-Phadoop-provided -Phadoop-2.7 -Pyarn -Phive -Phive-thriftserver`.

Closes apache#24184 from jzhuge/SPARK-26946-1.

Authored-by: John Zhuge <jzhuge@apache.org>
Signed-off-by: Sean Owen <sean.owen@databricks.com>
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.

8 participants