Repository: spark Updated Branches: refs/heads/master 57eddc718 -> b3af917e7
[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 #22902 from dongjoon-hyun/SPARK-25893. Authored-by: Dongjoon Hyun <dongj...@apache.org> Signed-off-by: Dongjoon Hyun <dongj...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/b3af917e Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/b3af917e Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/b3af917e Branch: refs/heads/master Commit: b3af917e76997faca9bd3ed3c5cb4dafd6fac1f3 Parents: 57eddc7 Author: Dongjoon Hyun <dongj...@apache.org> Authored: Wed Oct 31 09:20:19 2018 -0700 Committer: Dongjoon Hyun <dongj...@apache.org> Committed: Wed Oct 31 09:20:19 2018 -0700 ---------------------------------------------------------------------- .../org/apache/spark/sql/hive/client/IsolatedClientLoader.scala | 3 +++ 1 file changed, 3 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/b3af917e/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala ---------------------------------------------------------------------- diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala index 3189937..1e7a0b1 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala @@ -100,6 +100,9 @@ private[hive] object IsolatedClientLoader extends Logging { case "2.1" | "2.1.0" | "2.1.1" => hive.v2_1 case "2.2" | "2.2.0" => hive.v2_2 case "2.3" | "2.3.0" | "2.3.1" | "2.3.2" | "2.3.3" => hive.v2_3 + case version => + throw new UnsupportedOperationException(s"Unsupported Hive Metastore version ($version). " + + s"Please set ${HiveUtils.HIVE_METASTORE_VERSION.key} with a valid version.") } private def downloadVersion( --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org