rdblue commented on a change in pull request #1495:
URL: https://github.com/apache/iceberg/pull/1495#discussion_r496910142
##########
File path: core/src/main/java/org/apache/iceberg/BaseMetastoreCatalog.java
##########
@@ -215,8 +216,15 @@ public TableBuilder withProperty(String key, String value)
{
@Override
public Table create() {
TableOperations ops = newTableOps(identifier);
- if (ops.current() != null) {
- throw new AlreadyExistsException("Table already exists: %s",
identifier);
+ try {
+ if (ops.current() != null) {
+ throw new AlreadyExistsException("Table already exists: %s",
identifier);
+ }
+ } catch (NoSuchIcebergTableException ne) {
Review comment:
Is this correct?
If this happens, then the table exists and is not an Iceberg table. That is
expected if we are creating the table from the Hive hook, but in that case I
think that we will have injected metadata in the hook that signals to the
`TableOperations` implementation that the table was pre-created by Hive and
should be replaced (so update will be used for the initial commit). If we
detect that in `TableOperations` then we should be able to avoid throwing this
exception and return null like before.
If the operation is not happening inside of the Hive hooks, then we do want
to let the exception propagate because there is an existing Hive 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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]