rdblue commented on a change in pull request #1890:
URL: https://github.com/apache/iceberg/pull/1890#discussion_r538891015



##########
File path: 
spark3/src/main/java/org/apache/iceberg/spark/procedures/BaseProcedure.java
##########
@@ -79,10 +79,14 @@ protected Identifier toIdentifier(String 
identifierAsString, String argName) {
     try {
       catalogAndIdentifier = Spark3Util.catalogAndIdentifier(spark, 
identifierAsString, tableCatalog);
     } catch (ParseException e) {
-      throw new IllegalArgumentException(String.format("Cannot parse 
identifier [%s] for argument %s",
+      throw new IllegalArgumentException(String.format("Cannot parse 
identifier '%s' for argument %s",
           identifierAsString, argName), e);
     }
 
+    
Preconditions.checkArgument(catalogAndIdentifier.catalog().equals(tableCatalog),
 "Cannot run procedure" +
+        " in catalog '%s': Argument %s was set to '%s' which resolves to a 
table in a different catalog '%s'",
+        tableCatalog.name(), argName, identifierAsString, 
catalogAndIdentifier.catalog().name());

Review comment:
       This is really wordy. I'd probably simplify it to "Cannot run procedure 
%s in catalog %s: %s is a table in catalog %s".




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

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