mchades commented on code in PR #11926:
URL: https://github.com/apache/gravitino/pull/11926#discussion_r4123309448
##########
catalogs/catalog-hive/src/main/java/org/apache/gravitino/catalog/hive/HiveViewCatalogOperations.java:
##########
@@ -678,15 +686,16 @@ private String toHmsViewOriginalText(
TrinoNativeViewCodec.toTrinoTypeString(c.dataType()),
c.comment()))
.collect(Collectors.toList());
+ String owner = properties == null ? null :
properties.get(TRINO_VIEW_OWNER_PROPERTY);
Review Comment:
**[P1] Replacing a native DEFINER view as the same owner still turns it into
INVOKER.** Native Trino stores the owner in the encoded payload, without
`trino.internal.view.owner` in HMS parameters. `toHiveView()` exposes the
decoded owner as a property, so `computePropertyChanges()` emits no owner
update when the new owner is unchanged. However, `alterView()` copies the raw
HMS parameters into `updatedProperties`, so this lookup returns null and the
replacement is encoded with `runAsInvoker=true`.
I reproduced this through `CatalogConnectorMetadata.createView()` and
`HiveViewCatalogOperations.alterView()` with an in-memory HMS substitute.
Please initialize the owner from the decoded payload before applying changes,
and add a same-owner native-view replacement test.
--
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]