aokolnychyi commented on a change in pull request #362: Support create and replace transactions in Catalog URL: https://github.com/apache/incubator-iceberg/pull/362#discussion_r317377271
########## File path: core/src/main/java/org/apache/iceberg/BaseTransaction.java ########## @@ -241,7 +234,14 @@ private void commitCreateTransaction() { } } - private void commitReplaceTransaction() { + private void commitReplaceTransaction(boolean orCreate) { + if (base == null && !orCreate) { + throw new NoSuchTableException("Table doesn't exist"); + } else if (base == null) { + commitCreateTransaction(); Review comment: If `base` is null, I think we can either use `replaceMetadata` instead of `base` and keep the existing try-catch or we can actually call `commitCreateTransaction` wrapped in another try first. If we get `AlreadyExistsException`, we can call the second one, which will replace the table. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org