singhpk234 commented on code in PR #14831:
URL: https://github.com/apache/iceberg/pull/14831#discussion_r2616375735


##########
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:
   what if there are multiple dialects stored in the view obj, HMS just stores 
hive dialect ? 



-- 
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]

Reply via email to