jbonofre commented on code in PR #9770: URL: https://github.com/apache/iceberg/pull/9770#discussion_r1497831212
########## core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java: ########## @@ -812,4 +815,32 @@ private boolean deleteProperties(Namespace namespace, Set<String> properties) { protected Map<String, String> properties() { return catalogProperties == null ? ImmutableMap.of() : catalogProperties; } + + @Override + public TableBuilder buildTable(TableIdentifier identifier, Schema schema) { + return new ViewAwareTableBuilder(identifier, schema); + } + + /** + * The purpose of this class is to add view detection only when SchemaVersion.V1 schema is used + * when replacing a table. + */ + protected class ViewAwareTableBuilder extends BaseMetastoreCatalogTableBuilder { + + private final TableIdentifier identifier; + + public ViewAwareTableBuilder(TableIdentifier identifier, Schema schema) { + super(identifier, schema); + this.identifier = identifier; + } + + @Override + public Transaction replaceTransaction() { + if (schemaVersion == JdbcUtil.SchemaVersion.V1 && viewExists(identifier)) { Review Comment: That was the initial behavior, but it breaks some behavior when using `V0` schema. -- 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: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org