Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/12689#discussion_r61204047
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala
---
@@ -237,14 +237,6 @@ class HiveCommandSuite extends QueryTest with
SQLTestUtils with TestHiveSingleto
intercept[AnalysisException] {
sql(s"""LOAD DATA LOCAL INPATH "$incorrectUri" INTO TABLE
non_part_table""")
}
-
- // Unset default URI Scheme and Authority: throw exception
--- End diff --
// Unset default URI Scheme and Authority: throw exception
// HadoopConfiguration sets fs.default.name as alias of new YARN
setting fs.defaultFS.
// We only need to unset fs.default.name and reset it back.
val originalFsName =
hiveContext.sparkContext.hadoopConfiguration.get("fs.default.name")
// SQLConf's settings will be added into sessionState.newHadoopConf,
// so we need to unset it too. It has no alias, thus we need to unset
both two settings.
val oriDefaultFS =
hiveContext.sessionState.conf.getConfString("fs.defaultFS", null)
val oriDefaultFSName =
hiveContext.sessionState.conf.getConfString("fs.default.name", null)
hiveContext.sparkContext.hadoopConfiguration.unset("fs.default.name")
hiveContext.sessionState.conf.unsetConf("fs.defaultFS")
hiveContext.sessionState.conf.unsetConf("fs.default.name")
intercept[AnalysisException] {
sql(s"""LOAD DATA INPATH "$testData" INTO TABLE non_part_table""")
}
hiveContext.sparkContext.hadoopConfiguration.set("fs.default.name",
originalFsName)
if (oriDefaultFS != null) {
hiveContext.sessionState.conf.setConfString("fs.defaultFS",
oriDefaultFS)
}
if (oriDefaultFSName != null) {
hiveContext.sessionState.conf.setConfString("fs.default.name",
oriDefaultFSName)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]