wombatu-kun commented on code in PR #16620:
URL: https://github.com/apache/iceberg/pull/16620#discussion_r3502839636


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -172,6 +172,19 @@ protected HiveCatalog catalog() {
     return catalog;
   }
 
+  @Test
+  public void newTableSetsCurrentHmsLastAccessTime() throws TException {
+    TableIdentifier tableIdent = TableIdentifier.of(DB_NAME, 
"create_time_tbl");
+
+    int beforeSeconds = (int) (System.currentTimeMillis() / 1000);
+    catalog.createTable(tableIdent, getTestSchema());
+    int afterSeconds = (int) (System.currentTimeMillis() / 1000);
+
+    org.apache.hadoop.hive.metastore.api.Table hmsTable =
+        HIVE_METASTORE_EXTENSION.metastoreClient().getTable(DB_NAME, 
"create_time_tbl");
+    assertThat(hmsTable.getLastAccessTime()).isBetween(beforeSeconds, 
afterSeconds);

Review Comment:
   Done a603d3f - confirmed the embedded HMS overwrites createTime server-side 
(create_table_core in hive-metastore 2.3.10 calls setCreateTime 
unconditionally), so a getCreateTime() assertion would pass even with the fix 
reverted; added a comment on both the table and view tests noting 
lastAccessTime is the only field that reflects the client-supplied value.



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