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


##########
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 {

Review Comment:
   can you slightly update the test to have
   ```
   @Test
     public void testViewQueryIsUpdatedOnCommit() throws Exception {
       HiveViewOperations ops = (HiveViewOperations) ((BaseView) 
view).operations();
       assertThat(view.currentVersion().representations())
           .containsExactly(
               
ImmutableSQLViewRepresentation.builder().sql(VIEW_QUERY).dialect("hive").build());
   
       Table hmsTable = ops.loadHmsTable();
       assertThat(hmsTable.getViewOriginalText()).isEqualTo(VIEW_QUERY);
       assertThat(hmsTable.getViewExpandedText()).isEqualTo(VIEW_QUERY);
   
       String newQuery = "select * from ns.tbl2 limit 10";
       view =
           catalog
               .buildView(VIEW_IDENTIFIER)
               .withSchema(SCHEMA)
               .withDefaultNamespace(NS)
               .withQuery("hive", newQuery)
               .replace();
   
       assertThat(view.currentVersion().representations())
           .containsExactly(
               
ImmutableSQLViewRepresentation.builder().sql(newQuery).dialect("hive").build());
   
       Table updatedHmsTable = ops.loadHmsTable();
       assertThat(updatedHmsTable.getViewOriginalText()).isEqualTo(newQuery);
       assertThat(updatedHmsTable.getViewExpandedText()).isEqualTo(newQuery);
     }
   ```



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