Github user gatorsmile commented on a diff in the pull request: https://github.com/apache/spark/pull/16104#discussion_r91861824 --- 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 -- Do we have to issue an exception here? It sounds like this is the only place we block it. Do you think users might be able to use the higher version, although it might have a few issues?
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org