kevinjqliu commented on code in PR #16303:
URL: https://github.com/apache/iceberg/pull/16303#discussion_r3238398335


##########
spark/v3.4/spark/src/main/java/org/apache/iceberg/spark/source/SparkCopyOnWriteScan.java:
##########
@@ -118,26 +117,11 @@ public NamedReference[] filterAttributes() {
   }
 
   @Override
-  public void filter(Filter[] filters) {
-    Preconditions.checkState(
-        Objects.equals(snapshotId(), currentSnapshotId()),
-        "Runtime file filtering is not possible: the table has been 
concurrently modified. "
-            + "Row-level operation scan snapshot ID: %s, current table 
snapshot ID: %s. "
-            + "If an external process modifies the table, enable table caching 
in the catalog. "
-            + "If multiple threads modify the table, use independent Spark 
sessions in each thread.",
-        snapshotId(),
-        currentSnapshotId());
-
-    for (Filter filter : filters) {
-      // Spark can only pass In filters at the moment
-      if (filter instanceof In
-          && ((In) 
filter).attribute().equalsIgnoreCase(MetadataColumns.FILE_PATH.name())) {
-        In in = (In) filter;
-
-        Set<String> fileLocations = Sets.newHashSet();
-        for (Object value : in.values()) {
-          fileLocations.add((String) value);
-        }
+  public void filter(Predicate[] predicates) {
+    for (Predicate predicate : predicates) {

Review Comment:
   ```suggestion
       Preconditions.checkState(
           Objects.equals(snapshotId(), currentSnapshotId()),
           "Runtime file filtering is not possible: the table has been 
concurrently modified. "
               + "Row-level operation scan snapshot ID: %s, current table 
snapshot ID: %s. "
               + "If an external process modifies the table, enable table 
caching in the catalog. "
               + "If multiple threads modify the table, use independent Spark 
sessions in each thread.",
           snapshotId(),
           currentSnapshotId());
   
       for (Predicate predicate : predicates) {
   ```



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