Skip to content
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

[SPARK-14786] Remove hive-cli dependency from hive subproject #12551

Conversation

JoshRosen
Copy link
Contributor

The hive subproject currently depends on hive-cli in order to perform a check to see whether a SessionState is an instance of org.apache.hadoop.hive.cli.CliSessionState (see #9589). The introduction of this hive-cli dependency has caused problems for users whose Hive metastore JAR classpaths don't include the hive-cli classes (such as in #11495).

This patch removes this dependency on hive-cli and replaces the isInstanceOf check by reflection. I added a Maven Enforcer rule to ban hive-cli from the hive subproject in order to make sure that this dependency is not accidentally reintroduced.

/cc @rxin @yhuai @adrian-wang @preecet

<configuration>
<rules>
<bannedDependencies>
<excludes combine.children="append">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To verify that this does the correct thing, see

mvn -Phive -pl :spark-hive_2.11 help:effective-pom

@rxin
Copy link
Contributor

rxin commented Apr 21, 2016

LGTM pending Jenkins.

@@ -110,10 +109,20 @@ private[hive] class HiveClientImpl(
}
}

def isCliSessionState(state: SessionState): Boolean = {
var temp: Class[_] = state.getClass
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In a test, this ended up failing with an NPE so I guess that the comment on line 114 / 123 is incorrect :(

@adrian-wang
Copy link
Contributor

LGTM

@SparkQA
Copy link

SparkQA commented Apr 21, 2016

Test build #56455 has finished for PR 12551 at commit e8c6f35.

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

@SparkQA
Copy link

SparkQA commented Apr 21, 2016

Test build #56453 has finished for PR 12551 at commit 994fbae.

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

@JoshRosen
Copy link
Contributor Author

Jenkins, retest this please.

@SparkQA
Copy link

SparkQA commented Apr 21, 2016

Test build #56470 has finished for PR 12551 at commit e8c6f35.

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

@rxin
Copy link
Contributor

rxin commented Apr 21, 2016

Merging in master.

@asfgit asfgit closed this in cfe472a Apr 21, 2016
@JoshRosen JoshRosen deleted the remove-hive-cli-dep-from-hive-subproject branch April 21, 2016 05:56
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.

4 participants