Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/16104#discussion_r91886458
--- Diff:
sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala
---
@@ -121,21 +121,61 @@ case class InsertIntoHiveTable(
return dir
}
- private def getExternalScratchDir(extURI: URI, hadoopConf:
Configuration): Path = {
- getStagingDir(new Path(extURI.getScheme, extURI.getAuthority,
extURI.getPath), hadoopConf)
+ private def getExternalScratchDir(extURI: URI): Path = {
+ getStagingDir(new Path(extURI.getScheme, extURI.getAuthority,
extURI.getPath))
}
- def getExternalTmpPath(path: Path, hadoopConf: Configuration): Path = {
+ def getExternalTmpPath(path: Path): Path = {
+ val hiveVersion =
externalCatalog.asInstanceOf[HiveExternalCatalog].client.version.fullVersion
+ if (hiveVersion.startsWith("0.12") ||
+ hiveVersion.startsWith("0.13") ||
+ hiveVersion.startsWith("0.14") ||
+ hiveVersion.startsWith("1.0")) {
+ oldStyleExternalTempPath(path)
+ } else if (hiveVersion.startsWith("1.1") ||
hiveVersion.startsWith("1.2")) {
+ newStyleExternalTempPath(path)
+ } else {
+ throw new IllegalStateException("Unsupported hive version: " +
hiveVersion)
--- End diff --
We will fail in other places any way, e.g.
`IsolatedClientLoader.hiveVersion`
---
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]