Skip to content

Commit b3af917

Browse files
committed
[SPARK-25893][SQL] Show a directional error message for unsupported Hive Metastore versions
## What changes were proposed in this pull request? When `spark.sql.hive.metastore.version` is misconfigured, we had better give a directional error message. **BEFORE** ```scala scala> sql("show databases").show scala.MatchError: 2.4 (of class java.lang.String) ``` **AFTER** ```scala scala> sql("show databases").show java.lang.UnsupportedOperationException: Unsupported Hive Metastore version (2.4). Please set spark.sql.hive.metastore.version with a valid version. ``` ## How was this patch tested? Manual. Closes apache#22902 from dongjoon-hyun/SPARK-25893. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 57eddc7 commit b3af917

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ private[hive] object IsolatedClientLoader extends Logging {
100100
case "2.1" | "2.1.0" | "2.1.1" => hive.v2_1
101101
case "2.2" | "2.2.0" => hive.v2_2
102102
case "2.3" | "2.3.0" | "2.3.1" | "2.3.2" | "2.3.3" => hive.v2_3
103+
case version =>
104+
throw new UnsupportedOperationException(s"Unsupported Hive Metastore version ($version). " +
105+
s"Please set ${HiveUtils.HIVE_METASTORE_VERSION.key} with a valid version.")
103106
}
104107

105108
private def downloadVersion(

0 commit comments

Comments
 (0)