ebyhr commented on code in PR #14831:
URL: https://github.com/apache/iceberg/pull/14831#discussion_r2616591068
##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveViewCommits.java:
##########
@@ -111,6 +113,36 @@ public void dropTestView() throws IOException {
catalog.dropView(VIEW_IDENTIFIER);
}
+ @Test
+ public void testViewQueryIsUpdatedOnCommit() throws Exception {
+ HiveViewOperations ops = (HiveViewOperations) ((BaseView)
view).operations();
+ Table tbl = ops.loadHmsTable();
+ assertThat(tbl.getViewOriginalText()).isEqualTo(VIEW_QUERY);
+ assertThat(tbl.getViewExpandedText()).isEqualTo(VIEW_QUERY);
+
+ String newQuery = "select * from ns.tbl2 limit 10";
+ assertThat(VIEW_QUERY).isNotEqualTo(newQuery);
+
+ // update view query
+ view =
+ catalog
+ .buildView(VIEW_IDENTIFIER)
+ .withSchema(SCHEMA)
+ .withDefaultNamespace(NS)
+ .withQuery("hive", newQuery)
Review Comment:
I think the `HiveViewOperations.sqlFor` method retrieves the Hive dialect if
it exists, and falls back to another dialect if it doesn’t:
https://github.com/apache/iceberg/blob/bc23a774a3cb3b06a63289e445dbf91beb8b5254/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveViewOperations.java#L307-L321
--
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]