File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
sql/core/src/main/scala/org/apache/spark/sql/api/r Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ private[sql] object SQLUtils extends Logging {
5252 if (enableHiveSupport &&
5353 jsc.sc.conf.get(CATALOG_IMPLEMENTATION .key, " hive" ).toLowerCase(Locale .ROOT ) ==
5454 " hive" &&
55+ // Note that the order of conditions here are on purpose.
56+ // `SparkSession.hiveClassesArePresent` checks if Hive's `HiveConf` is loadable or not;
57+ // however, `HiveConf` itself has some static logic to check if Hadoop version is
58+ // supported or not, which throws an `IllegalArgumentException` if unsupported.
59+ // If this is checked first, there's no way to disable Hive support in the case above.
60+ // So, we intentionally check if Hive classes are loadable or not only when
61+ // Hive support is explicitly enabled by short-circuiting. See also SPARK-26422.
5562 SparkSession .hiveClassesArePresent) {
5663 SparkSession .builder().sparkContext(withHiveExternalCatalog(jsc.sc)).getOrCreate()
5764 } else {
You can’t perform that action at this time.
0 commit comments