jtuglu1 commented on code in PR #18953:
URL: https://github.com/apache/druid/pull/18953#discussion_r2734722206


##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergCatalog.java:
##########
@@ -100,12 +127,47 @@ public List<String> extractSnapshotDataFiles(
 
       tableScan = tableScan.caseSensitive(isCaseSensitive());
       CloseableIterable<FileScanTask> tasks = tableScan.planFiles();
-      CloseableIterable.transform(tasks, FileScanTask::file)
-                       .forEach(dataFile -> 
dataFilePaths.add(dataFile.path().toString()));
+
+      Expression detectedResidual = null;
+      for (FileScanTask task : tasks) {
+        dataFilePaths.add(task.file().path().toString());
+
+        // Check for residual filters if mode is not IGNORE
+        if (effectiveMode != ResidualFilterMode.IGNORE && detectedResidual == 
null) {
+          Expression residual = task.residual();
+          if (residual != null && !residual.equals(Expressions.alwaysTrue())) {

Review Comment:
   I don't think so. If you change partitions, etc. I think it can still be 
non-null. Partitions created via void transforms are another possibility. If 
there is residual, it should show up regardless of filtereed-column 
partitioning.



##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/IcebergCatalog.java:
##########
@@ -100,12 +127,47 @@ public List<String> extractSnapshotDataFiles(
 
       tableScan = tableScan.caseSensitive(isCaseSensitive());
       CloseableIterable<FileScanTask> tasks = tableScan.planFiles();
-      CloseableIterable.transform(tasks, FileScanTask::file)
-                       .forEach(dataFile -> 
dataFilePaths.add(dataFile.path().toString()));
+
+      Expression detectedResidual = null;
+      for (FileScanTask task : tasks) {
+        dataFilePaths.add(task.file().path().toString());
+
+        // Check for residual filters if mode is not IGNORE
+        if (effectiveMode != ResidualFilterMode.IGNORE && detectedResidual == 
null) {
+          Expression residual = task.residual();
+          if (residual != null && !residual.equals(Expressions.alwaysTrue())) {

Review Comment:
   I don't think so. If you change partitions, etc. I think it can still be 
non-null. Partitions created via void transforms are another possibility. If 
there is residual, it should show up regardless of filtered-column partitioning.



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