ebyhr commented on code in PR #15489:
URL: https://github.com/apache/iceberg/pull/15489#discussion_r2870108111
##########
core/src/main/java/org/apache/iceberg/rest/RESTSessionCatalog.java:
##########
@@ -1711,6 +1713,29 @@ private View replace(LoadViewResponse response) {
.max(Integer::compareTo)
.orElseGet(metadata::currentVersionId);
+ if (PropertyUtil.propertyAsBoolean(
+ properties,
+ ViewProperties.REPLACE_DROP_DIALECT_ALLOWED,
+ ViewProperties.REPLACE_DROP_DIALECT_ALLOWED_DEFAULT)) {
+ Map<String, ViewRepresentation> representationsMap = Maps.newHashMap();
+ for (ViewRepresentation representation : representations) {
+ if (representation instanceof SQLViewRepresentation) {
+ representationsMap.put(
+ ((SQLViewRepresentation) representation).dialect(),
representation);
+ }
+ }
+
+ for (ViewRepresentation representation :
+ response.metadata().currentVersion().representations()) {
Review Comment:
`response.metadata()` can be replaced with `metadata`.
##########
core/src/main/java/org/apache/iceberg/view/BaseMetastoreViewCatalog.java:
##########
@@ -241,6 +241,28 @@ private View replace(ViewOperations ops) {
.max(Integer::compareTo)
.orElseGet(metadata::currentVersionId);
+ if (PropertyUtil.propertyAsBoolean(
+ properties,
+ ViewProperties.REPLACE_DROP_DIALECT_ALLOWED,
+ ViewProperties.REPLACE_DROP_DIALECT_ALLOWED_DEFAULT)) {
+ Map<String, ViewRepresentation> representationsMap = Maps.newHashMap();
+ for (ViewRepresentation representation : representations) {
+ if (representation instanceof SQLViewRepresentation) {
+ representationsMap.put(
+ ((SQLViewRepresentation) representation).dialect(),
representation);
+ }
+ }
+
+ for (ViewRepresentation representation :
ops.current().currentVersion().representations()) {
Review Comment:
`ops.current()` can be replaced with `metadata`.
--
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]