Skip to content

Conversation

@AngersZhuuuu
Copy link
Contributor

@AngersZhuuuu AngersZhuuuu commented Sep 12, 2019

What changes were proposed in this pull request?

Hive 2.3 will set a new UDFClassLoader to hiveConf.classLoader when initializing SessionState since HIVE-11878, and

  1. ADDJarCommand will add jars to clientLoader.classLoader.
  2. --jar passed jar will be added to clientLoader.classLoader
  3. jar passed by hive conf hive.aux.jars SPARK-28954 SPARK-28840 will be added to clientLoader.classLoader too

For these reason we cannot load the jars added by ADDJarCommand because of class loader got changed. We reset it to clientLoader.ClassLoader here.

Why are the changes needed?

support for jdk11

Does this PR introduce any user-facing change?

NO

How was this patch tested?

UT

export JAVA_HOME=/usr/lib/jdk-11.0.3
export PATH=$JAVA_HOME/bin:$PATH

build/sbt -Phive-thriftserver -Phadoop-3.2

hive/test-only *HiveSparkSubmitSuite -- -z "SPARK-8368: includes jars passed in through --jars"
hive-thriftserver/test-only *HiveThriftBinaryServerSuite -- -z "test add jar"

@dongjoon-hyun
Copy link
Member

ok to test.

@SparkQA
Copy link

SparkQA commented Sep 12, 2019

Test build #110523 has finished for PR 25775 at commit edaf402.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@dongjoon-hyun
Copy link
Member

Retest this please.

@AngersZhuuuu
Copy link
Contributor Author

AngersZhuuuu commented Sep 12, 2019

Retest this please.

ThriftServer MetaData Operation and CLI have some rely on SessionState. Some code rely on hive code too much.

@SparkQA
Copy link

SparkQA commented Sep 12, 2019

Test build #110529 has finished for PR 25775 at commit 098a432.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 12, 2019

Test build #110532 has finished for PR 25775 at commit 098a432.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 13, 2019

Test build #110548 has finished for PR 25775 at commit 07dd32e.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 13, 2019

Test build #110551 has finished for PR 25775 at commit 35f0a01.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 13, 2019

Test build #110555 has finished for PR 25775 at commit fb39a53.

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

@AngersZhuuuu AngersZhuuuu changed the title [WIP][SPARK-29015][SQL][test-hadoop3.2][test-java11] fix bug for jdk11, can't use 'add jar' jar's class as create table serde [WIP][SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' jar's class as create table serde Sep 13, 2019
@AngersZhuuuu
Copy link
Contributor Author

@dongjoon-hyun
Hi , I have change it to jdk8, please trigger building again.
Then I will change title to hadoop2.7.

@dongjoon-hyun
Copy link
Member

Retest this please.

@AngersZhuuuu AngersZhuuuu changed the title [WIP][SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' jar's class as create table serde [WIP][SPARK-29015][SQL] fix bug for jdk11, can't use 'add jar' jar's class as create table serde Sep 13, 2019
@SparkQA
Copy link

SparkQA commented Sep 13, 2019

Test build #110561 has finished for PR 25775 at commit fb39a53.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AngersZhuuuu AngersZhuuuu changed the title [WIP][SPARK-29015][SQL] fix bug for jdk11, can't use 'add jar' jar's class as create table serde [WIP][SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' jar's class as create table serde Sep 13, 2019
@SparkQA
Copy link

SparkQA commented Sep 14, 2019

Test build #110587 has finished for PR 25775 at commit a510a23.

  • This patch fails Scala style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Sep 14, 2019

Test build #110588 has finished for PR 25775 at commit bc73663.

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

@SparkQA
Copy link

SparkQA commented Sep 16, 2019

Test build #110640 has finished for PR 25775 at commit 35c961f.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@wangyum
Copy link
Member

wangyum commented Sep 17, 2019

This PR tested by HiveThriftBinaryServerSuite#test add jar?

@SparkQA
Copy link

SparkQA commented Sep 17, 2019

Test build #110771 has finished for PR 25775 at commit f30d001.

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

@SparkQA
Copy link

SparkQA commented Sep 17, 2019

Test build #110805 has finished for PR 25775 at commit 4db3b54.

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

@AngersZhuuuu AngersZhuuuu changed the title [WIP][SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' jar's class as create table serde [SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' jar's class as create table serde Sep 20, 2019
@wangyum
Copy link
Member

wangyum commented Sep 25, 2019

@AngersZhuuuu Could you add these to How was this patch tested?:

export JAVA_HOME=/usr/lib/jdk-11.0.3
export PATH=$JAVA_HOME/bin:$PATH

build/sbt -Phive-thriftserver -Phadoop-3.2

hive/test-only *HiveSparkSubmitSuite -- -z "SPARK-8368: includes jars passed in through --jars"
hive-thriftserver/test-only *HiveThriftBinaryServerSuite -- -z "test add jar"

@srowen
Copy link
Member

srowen commented Sep 25, 2019

@wangyum per your comment at #25690 let's merge this first. It looks like it has passed a few times, but I see a number of failures too; since you have been following this more closely, they were due to previous versions of the change? the comment and change sound plausible.

@wangyum
Copy link
Member

wangyum commented Sep 25, 2019

I see. Thank you @srowen

@SparkQA
Copy link

SparkQA commented Sep 25, 2019

Test build #111360 has finished for PR 25775 at commit f37335c.

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

@dongjoon-hyun
Copy link
Member

Could we revise the PR title more specifically, @AngersZhuuuu and @wangyum ?

@AngersZhuuuu AngersZhuuuu changed the title [SPARK-29015][SQL][test-hadoop3.2] fix bug for jdk11, can't use 'add jar' jar's class as create table serde [SPARK-29015][SQL][test-hadoop3.2]Reset class loader after initializing SessionState for built-in Hive 2.3 Sep 26, 2019
// got changed. We reset it to clientLoader.ClassLoader here.
if (HiveUtils.isHive23) {
state.getConf.setClassLoader(clientLoader.classLoader)
}
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

No opinion from me, I know too little context of how these classloaders should be used to review.

@srowen
Copy link
Member

srowen commented Sep 27, 2019

Merged to master

// since HIVE-11878, and ADDJarCommand will add jars to clientLoader.classLoader.
// For this reason we cannot load the jars added by ADDJarCommand because of class loader
// got changed. We reset it to clientLoader.ClassLoader here.
if (HiveUtils.isHive23) {
Copy link
Member

Choose a reason for hiding this comment

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

Why not set the classLoader blindly to clientLoader.classLoader? HIVE-11878 got merged into hive 1.3.0 and 2.0.0? This issue can still exist in the production environment when we try to use non-builtin hive libraries.

cc @ulysses-you @cloud-fan @wangyum @AngersZhuuuu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants