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 2021/09/20 18:03:42 UTC

[GitHub] [iceberg] RussellSpitzer commented on a change in pull request #3126: Throw exception when uri is configured for hive catalog

RussellSpitzer commented on a change in pull request #3126:
URL: https://github.com/apache/iceberg/pull/3126#discussion_r712396391



##########
File path: spark3/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java
##########
@@ -240,8 +245,38 @@ public void renameTable(Identifier from, Identifier to) throws NoSuchTableExcept
     }
   }
 
+  public boolean isHiveCatalogConfigValid(CaseInsensitiveStringMap options, StringBuilder errorMsg) {
+    String hadoopConfUri = SparkSession.active().sparkContext().conf().contains("spark.hadoop.hive.metastore.uris") ?
+            SparkSession.active().sparkContext().conf().get("spark.hadoop.hive.metastore.uris") : null;
+    String catalogConfUri = options.get("uri");
+
+    if (hadoopConfUri == null) {
+      errorMsg.append("Hive uri config is missing");

Review comment:
       I feel like it's fine to just always error out, Less complicated and doesn't give the impression that it should work sometimes :) The real problem I think with checking for Hadoop parameters is they could have configured a direct metastore connection (embedded hive) or some other config which doesn't have a URI value.




-- 
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