ayushtkn commented on code in PR #4761:
URL: https://github.com/apache/hive/pull/4761#discussion_r1347860613


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java:
##########
@@ -488,6 +490,9 @@ private void commitWrite(Table table, String branchName, 
Long snapshotId, long s
       if (snapshotId != null) {
         write.validateFromSnapshot(snapshotId);
       }
+      Expression conflictDetectionFilter =  
Expressions.and(Expressions.alwaysTrue(), filterExpr);

Review Comment:
   why is this AND true required, isn't
   True And expr = filterExpr?
   The filterExpr was build with these AND only right?



##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergOutputCommitter.java:
##########
@@ -408,12 +409,12 @@ private void commitTable(FileIO io, ExecutorService 
executor, OutputTable output
 
     Table table = null;
     String branchName = null;
-
+    Expression filterExpr = Expressions.alwaysTrue();
     for (JobContext jobContext : outputTable.jobContexts) {
       JobConf conf = jobContext.getJobConf();
       table = Optional.ofNullable(table).orElse(Catalogs.loadTable(conf, 
catalogProperties));
       branchName = conf.get(InputFormatConfig.OUTPUT_TABLE_SNAPSHOT_REF);
-
+      filterExpr = Expressions.and(filterExpr, 
HiveIcebergStorageHandler.getQueryFilter(conf));

Review Comment:
   not sure what is happening here.
   filterExpr is true, and we do a AND with that, why?
   we go inside ``getQueryFilter``, in that again we have a ``true`` and then 
we do a AND
   ```
     Expression expr = Expressions.alwaysTrue();
       try {
         expr = Expressions.and(expr,
   ```
   
   Final it looks like TRUE AND (TRUE AND EXPR)
   why is it not just EXPR?



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to