aokolnychyi commented on a change in pull request #1890:
URL: https://github.com/apache/iceberg/pull/1890#discussion_r539318156
##########
File path:
spark3/src/main/java/org/apache/iceberg/spark/procedures/BaseProcedure.java
##########
@@ -75,19 +73,18 @@ protected Identifier toIdentifier(String
identifierAsString, String argName) {
Preconditions.checkArgument(identifierAsString != null &&
!identifierAsString.isEmpty(),
"Cannot handle an empty identifier for argument %s", argName);
- CatalogAndIdentifier catalogAndIdentifier;
- try {
- catalogAndIdentifier = Spark3Util.catalogAndIdentifier(spark,
identifierAsString, tableCatalog);
- } catch (ParseException e) {
- throw new IllegalArgumentException(String.format("Cannot parse
identifier '%s' for argument %s",
- identifierAsString, argName), e);
- }
+ CatalogAndIdentifier catalogAndIdentifier =
Spark3Util.catalogAndIdentifier(
+ "identifier for arg " + argName, spark, identifierAsString,
tableCatalog);
+
+ CatalogPlugin catalog = catalogAndIdentifier.catalog();
+ Identifier identifier = catalogAndIdentifier.identifier();
-
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());
+ Preconditions.checkArgument(
+ catalog.equals(tableCatalog),
+ "Cannot run procedure in catalog %s: %s is a table in catalog %s",
+ tableCatalog.name(), identifierAsString, catalog);
Review comment:
I missed to call `catalog.name()` on the third arg.
----------------------------------------------------------------
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]