itachi-sharingan commented on a change in pull request #3126:
URL: https://github.com/apache/iceberg/pull/3126#discussion_r711781189



##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java
##########
@@ -242,6 +242,13 @@ public void renameTable(Identifier from, Identifier to) 
throws NoSuchTableExcept
 
   @Override
   public final void initialize(String name, CaseInsensitiveStringMap options) {
+    if (options.containsKey("type") && 
options.get("type").equalsIgnoreCase("hive") && options.containsKey("uri")) {
+      throw new UnsupportedOperationException("Cannot set an alternative uri 
when" +
+              " using the SparkSessionCatalog, " +
+              "make an alternative SparkCatalog if the " +
+              "Spark Session catalog and Iceberg " +
+              "catalog should contact different metastores.");
+    }

Review comment:
       Made the change, pls check, also I was thinking we can add this check 
doc here - 
https://iceberg.apache.org/spark-configuration/#replacing-the-session-catalog, 
if it already not present elsewhere.

##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/SparkSessionCatalog.java
##########
@@ -242,6 +242,13 @@ public void renameTable(Identifier from, Identifier to) 
throws NoSuchTableExcept
 
   @Override
   public final void initialize(String name, CaseInsensitiveStringMap options) {
+    if (options.containsKey("type") && 
options.get("type").equalsIgnoreCase("hive") && options.containsKey("uri")) {
+      throw new UnsupportedOperationException("Cannot set an alternative uri 
when" +
+              " using the SparkSessionCatalog, " +
+              "make an alternative SparkCatalog if the " +
+              "Spark Session catalog and Iceberg " +
+              "catalog should contact different metastores.");

Review comment:
       done




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to