JingsongLi commented on code in PR #249:
URL: https://github.com/apache/paimon-rust/pull/249#discussion_r3090692135


##########
crates/paimon/src/table/table_scan.rs:
##########
@@ -461,6 +461,21 @@ impl<'a> TableScan<'a> {
         let deletion_vectors_enabled = core_options.deletion_vectors_enabled();
         let data_evolution_enabled = core_options.data_evolution_enabled();
 
+        let has_primary_keys = !self.table.schema().primary_keys().is_empty();
+
+        // Skip level-0 files for PK tables when:
+        // - DV mode: level-0 files are unmerged, DV handles dedup at higher 
levels
+        // - FirstRow engine without DV: reads go through DataFileReader (no 
merge),
+        //   so only compacted (level > 0) files are safe to read directly
+        let skip_level_zero = if has_primary_keys {

Review Comment:
   Good point!



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