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


##########
hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveCatalog.java:
##########
@@ -172,6 +172,22 @@ 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);
+
+    // HMS overwrites createTime server-side on create, but keeps the 
lastAccessTime that Iceberg
+    // sends. Computing it as '(int) currentTimeMillis / 1000' casts the long 
before dividing and
+    // overflows to a 1970-era value; assert it instead reflects the current 
epoch second.

Review Comment:
   Done 2334107 - also dropped the mirrored comment in the view 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to