You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/09/09 06:36:10 UTC

[GitHub] [iceberg] linyanghao commented on a diff in pull request #5693: Spark: Check for hive support when using SparkSessionCatalog

linyanghao commented on code in PR #5693:
URL: https://github.com/apache/iceberg/pull/5693#discussion_r966673279


##########
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java:
##########
@@ -289,6 +292,19 @@ public final void initialize(String name, CaseInsensitiveStringMap options) {
     this.createOrcAsIceberg = options.getBoolean("orc-enabled", createOrcAsIceberg);
   }
 
+  private void checkHiveSupport() {
+    RuntimeConfig runtimeConfig = SparkSession.active().conf();
+    String sparkCatalogImpl = runtimeConfig.get(StaticSQLConf.CATALOG_IMPLEMENTATION().key());
+    if (sparkCatalogImpl != null) {
+      Preconditions.checkArgument(
+          sparkCatalogImpl.equals("hive"),
+          "Please enable hive support for Spark. "

Review Comment:
   > should the error msg mention how to enable it? `Please enable hive support for Spark by setting 'spark.sql.catalogImplementation=hive'` or something along those lines
   
   How about `Please enable hive support for Spark by calling enableHiveSupport() or setting 'spark.sql.catalogImplementation=hive'`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org