Uh oh!
There was an error while loading. Please reload this page.
[SPARK-17051][SQL] we should use hadoopConf in InsertIntoHiveTable - #14634
[SPARK-17051][SQL] we should use hadoopConf in InsertIntoHiveTable#14634cloud-fan wants to merge 2 commits into
Conversation
cloud-fan
commented
Aug 14, 2016
cc @yhuai |
SparkQA
commented
Aug 14, 2016
Test build #63746 has finished for PR 14634 at commit
|
gatorsmile
commented
Aug 14, 2016
Great! It resolves my original concern. Thanks! |
gatorsmile
commented
Aug 14, 2016
If it is controlled by hadoopConf, users might hit strange errors when using our DataFrameWriter APIs. |
cloud-fan
commented
Aug 15, 2016
I think it's hive only conf? Normal data source relation should not read this conf. |
If users want to use the Let me use a test case to show the issue. withTempDir { tmpDir =>valbasePath= tmpDir.getCanonicalPath
valexternalTab="extTable_with_partitions"
withTable(externalTab) {
assert(tmpDir.listFiles.isEmpty)
sql(
s""" |CREATE EXTERNAL TABLE $externalTab (key INT, value STRING) |PARTITIONED BY (ds STRING, hr STRING) |stored as Parquet |LOCATION '$basePath'""".stripMargin)
// SQL interface
withSQLConf("hive.exec.dynamic.partition"->"false") {
for (ds <-Seq("2008-04-08", "2008-04-09"); hr <-Seq("11", "12")) {
sql(
s""" |INSERT OVERWRITE TABLE $externalTab
|partition (ds='$ds',hr='$hr') |SELECT 1, 'a'""".stripMargin)
}
}
// DataFrameWriter interface
withSQLConf("hive.exec.dynamic.partition"->"true",
"hive.exec.dynamic.partition.mode"->"nonstrict") {
Seq((1, "2", "2008-04-09", "12")).toDF("key", "value", "ds", "hr").write
.insertInto(externalTab)
}
}
} |
gatorsmile
commented
Aug 15, 2016
Sorry, let me rephrase the potential issue.
|
cloud-fan
commented
Aug 15, 2016
|
gatorsmile
commented
Aug 15, 2016
uh, I see. Thank you! No more question. : ) |
yhuai
commented
Aug 15, 2016
Sorry. What's the necessity to make this change? |
gatorsmile
commented
Aug 15, 2016
Based on my understanding, after this PR, we will respect the conf values of |
JoshRosen
commented
Sep 19, 2016
@yhuai, @cloud-fan What's the status of this issue? Should this still be targeted for 2.0.1 (which it is currently in JIRA)? |
cloud-fan
commented
Sep 20, 2016
cc @yhuai , In |
cloud-fan
commented
Sep 20, 2016
retest this please |
cloud-fan
commented
Sep 20, 2016
@JoshRosen this is a regression in 2.0(it works in 1.6), so I think we should target it to 2.0 |
SparkQA
commented
Sep 20, 2016
Test build #65620 has finished for PR 14634 at commit
|
yhuai
commented
Sep 20, 2016
This change looks good. Let's add a regression test. |
SparkQA
commented
Sep 20, 2016
Test build #65629 has finished for PR 14634 at commit
|
yhuai
commented
Sep 20, 2016
LGTM. Merging to master and branch 2.0. |
## What changes were proposed in this pull request? Hive confs in hive-site.xml will be loaded in `hadoopConf`, so we should use `hadoopConf` in `InsertIntoHiveTable` instead of `SessionState.conf` ## How was this patch tested? N/A Author: Wenchen Fan <wenchen@databricks.com> Closes#14634 from cloud-fan/bug. (cherry picked from commit eb004c6) Signed-off-by: Yin Huai <yhuai@databricks.com>
What changes were proposed in this pull request?
Hive confs in hive-site.xml will be loaded in
hadoopConf, so we should usehadoopConfinInsertIntoHiveTableinstead ofSessionState.confHow was this patch tested?
N/A