wangyong9999 commented on code in PR #9460:
URL: https://github.com/apache/paimon/pull/9460#discussion_r3885659994


##########
paimon-python/pypaimon/table/source/primary_key_sorted_index_scan.py:
##########
@@ -77,9 +77,12 @@ def plan(snapshot_id, data_splits, definitions, 
index_entries):
     groups_by_bucket = {}
     for bucket, data_files in data_files_by_bucket.items():
         payloads = payloads_by_bucket.get(bucket, [])
-        active_sources = {
-            PrimaryKeyIndexSourceFile(f.file_name, f.row_count) for f in 
data_files
-        }
+        active_sources_by_level = {}
+        for data_file in data_files:
+            if data_file.file_source == 1 and data_file.level > 0:

Review Comment:
   nit: this is now the fourth inline copy of `file_source == 1 and level > 0` 
in pypaimon (the state builder, this scan, vector scan, full-text scan), while 
Java keeps it in one place (`PrimaryKeyIndexSourcePolicy`). Given the bug this 
PR fixes is exactly the state side and the scan side disagreeing about the 
active set, a small shared `should_read(data_file)` helper used by all four 
call sites would keep them from drifting apart.



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

Reply via email to