zhangyue19921010 opened a new pull request, #11126:
URL: https://github.com/apache/paimon/pull/11126

   ### Purpose
   
   Fixes #11125.
   
   Reading a legacy BTree index containing empty strings and NULLs can silently 
drop matching rows. Its zero-length bounds are indistinguishable from an 
all-NULL file, so current metadata pruning and TopN can exclude valid results.
   
   Preserve that ambiguity, recover bounds from the index file, and retain TopN 
candidate files when their metadata cannot establish an ordering. Ambiguous 
legacy files may require additional index reads; modern metadata keeps its 
existing pruning behavior.
   
   ### Tests
   
   Three table regression cases fail on unchanged production code at 
`31f3db767`: equality filtering, scalar prefiltering, and TopN across legacy 
and modern ranges. They pass with the fix. Fixtures use V1 index files plus the 
original nine-byte metadata encoding; the full historical writer was not 
executed.
   
   446 related tests passed on JDK 11, including numeric all-NULL controls, 
existing BTree/Bitmap reads and composite indexes. Checkstyle, Spotless, 
Enforcer and RAT passed without `fast-build`.
   
   ```sh
   mvn -pl paimon-core -am -DwildcardSuites=none -DfailIfNoTests=false \
     
-Dtest=SortedIndexFileMetaTest,SortedFileMetaSelectorTest,BTreeIndexReaderTest,LazyFilteredBTreeIndexReaderTest,BTreeTopNIndexFileSelectorTest,LegacyBTreeGlobalIndexTableTest,BtreeGlobalIndexTableTest,CompositeBTreeTableTest,LazyFilteredBitmapIndexReaderTest
 verify
   ```
   
   AI-generated with OpenAI Codex; independently reviewed by an AI agent. No 
human review is claimed.
   


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