veghlaci05 commented on code in PR #4279:
URL: https://github.com/apache/hive/pull/4279#discussion_r1184964019


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergStorageHandler.java:
##########
@@ -1297,8 +1297,12 @@ public boolean 
shouldOverwrite(org.apache.hadoop.hive.ql.metadata.Table mTable,
   public Boolean hasAppendsOnly(org.apache.hadoop.hive.ql.metadata.Table 
hmsTable, SnapshotContext since) {
     TableDesc tableDesc = Utilities.getTableDesc(hmsTable);
     Table table = IcebergTableUtil.getTable(conf, tableDesc.getProperties());
-    boolean foundSince = false;
-    for (Snapshot snapshot : table.snapshots()) {
+    return hasAppendsOnly(table.snapshots(), since);
+  }
+
+  public Boolean hasAppendsOnly(Iterable<Snapshot> snapshots, SnapshotContext 
since) {
+    boolean foundSince = since == null;

Review Comment:
   OK, it's very compact and efficient construct, so although it was a bit 
confusing for me, I'm fine with it.



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