Skip to content

Commit 43f1574

Browse files
committed
Add some commnets
1 parent 9dc80ce commit 43f1574

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sql/core/src/main/scala/org/apache/spark/sql/api/r/SQLUtils.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)