JingsongLi commented on code in PR #9999:
URL: https://github.com/apache/paimon/pull/9999#discussion_r4056455339
##########
paimon-python/pypaimon/globalindex/global_index_result.py:
##########
@@ -38,18 +42,20 @@ def offset(self, start_offset: int) -> 'GlobalIndexResult':
offset_bitmap = RoaringBitmap64()
for row_id in bitmap:
offset_bitmap.add(row_id + start_offset)
- return SimpleGlobalIndexResult(offset_bitmap)
+ return SimpleGlobalIndexResult(offset_bitmap, self.is_exact())
def and_(self, other: 'GlobalIndexResult') -> 'GlobalIndexResult':
"""Returns the intersection of this result and the other result."""
return SimpleGlobalIndexResult(
- RoaringBitmap64.and_(self.results(), other.results())
+ RoaringBitmap64.and_(self.results(), other.results()),
+ self.is_exact() and other.is_exact(),
Review Comment:
[P2] Preserve exactness when intersecting independent readers for the same
predicate
This AND rule is conservative for composing different predicates, but
GlobalIndexEvaluator._combine_reader_results also uses it for multiple index
readers answering the same leaf. With both BTree and bitmap indexes on name and
a filter such as name LIKE "%zeta%", BTree returns an inexact superset while
bitmap returns the exact match. Their intersection is exactly the bitmap
result, but this marks it inexact; with
global-index.filter.refine-from-data=false the vector path then discards the
valid rows and returns an empty result.
Please keep the conservative rule for predicate conjunctions, but give
same-leaf reader intersection its own semantics: an exact reader makes the
intersection exact. Add a mixed BTree plus bitmap regression for refinement
both disabled and enabled.
--
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]