JeonDaehong commented on code in PR #1145:
URL: https://github.com/apache/paimon-rust/pull/1145#discussion_r4348870377


##########
crates/paimon/src/table/global_index_scanner/evaluator.rs:
##########
@@ -386,6 +387,27 @@ impl GlobalIndexScanner {
         &self,
         entries: &[&GlobalIndexEntry],
         predicates: &[(PredicateOperator, &[Datum], &DataType)],
+    ) -> Result<Option<(Vec<RowRange>, Vec<RowRange>, bool)>> {
+        // A bitmap answers floating ranges and negations with every non-null
+        // row (see `bitmap_meta_may_match`), so those results are candidates
+        // only. Sorted indexes answer them exactly.
+        let bitmap_superset = entries

Review Comment:
   Good catch, thanks (189d400). An all-NULL bitmap shard is pruned before it 
answers anything, so it shouldn't count either. The flag now only considers 
bitmap entries that aren't `only_nulls()`. I added your Bitmap-on-NULLs + BTree 
+ IVF-flat case with refinement off. Without the change it returns `[]`, with 
it row 2.
   



##########
crates/paimon/src/arrow/residual.rs:
##########
@@ -166,9 +166,16 @@ pub(crate) fn evaluate_predicate_mask(
             else {
                 return Ok(None);
             };
-            Ok(Some(boolean_mask_from_predicate(mask.len(), |row_index| {
-                !mask.value(row_index)
-            })))
+            let negated =
+                boolean_mask_from_predicate(mask.len(), |row_index| 
!mask.value(row_index));
+            if let Some(guard) = inner.not_null_guard() {

Review Comment:
   Right, the outer `Not` had no guard when its child was another `Not`. 
`not_null_guard` now passes through a nested `Not`, so `Not(Not(v = 1))` takes 
`v`'s guard in both the residual and row evaluation. The new test reads and 
deletes with it, with and without the INT→BIGINT widening, and returns `[1]` 
again (`[0, 1]` before).
   
   Side note: clippy on the rebased branch fails on an unused `BinaryRow` 
import in `table_upsert.rs` from #1198, which this PR doesn't touch.
   



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