-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-5794] [SQL] fix add jar #4586
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
Changes from 6 commits
95a40da
1898309
0810e71
9957d87
32c4fb8
6c707e8
efdd602
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -79,7 +79,7 @@ case class AddJar(path: String) extends RunnableCommand { | |
| val hiveContext = sqlContext.asInstanceOf[HiveContext] | ||
| hiveContext.runSqlHive(s"ADD JAR $path") | ||
| hiveContext.sparkContext.addJar(path) | ||
| Seq.empty[Row] | ||
| Seq(Row(0)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adrian-wang Why we need a Row with a value of 0 at here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hive would return a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I thought it may be better to comment at the original pr). OK, I see. In future, let's make sure we also update the |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -793,6 +793,20 @@ class HiveQuerySuite extends HiveComparisonTest with BeforeAndAfter { | |
| sql("DROP TABLE alter1") | ||
| } | ||
|
|
||
| test("ADD JAR command 2") { | ||
| val testJar = TestHive.getHiveFile("data/files/hive-hcatalog-core-0.13.1.jar").getCanonicalPath | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you put this jar somewhere else? The stuff inside of resources/data are often replaced completely with files from hive. Perhaps just in the top level resources dir. |
||
| val testData = TestHive.getHiveFile("data/files/sample.json").getCanonicalPath | ||
| if (HiveShim.version == "0.13.1") { | ||
| sql(s"ADD JAR $testJar") | ||
| sql( | ||
| """CREATE TABLE t1(a string, b string) | ||
| |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'""".stripMargin) | ||
| sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE t1""") | ||
| sql("select * from src join t1 on src.key = t1.a") | ||
| sql("DROP TABLE t1") | ||
| } | ||
| } | ||
|
|
||
| test("ADD FILE command") { | ||
| val testFile = TestHive.getHiveFile("data/files/v1.txt").getCanonicalFile | ||
| sql(s"ADD FILE $testFile") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just need "proc.isInstanceOf[AddResourceProcessor]", then "add file" will work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree