nastra commented on code in PR #9770:
URL: https://github.com/apache/iceberg/pull/9770#discussion_r1497818067
##########
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's what's already happening and this breaks existing functionality when
using the catalog with v0. So we actually need to skip checking for views when
the schema is v0
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]