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

   ### Purpose
   
   close #9623
   
   `BTreeIndexReader.visitIn` fed every literal in the list straight into 
`rangeQuery`, which serializes the key and compares it, so a null literal threw 
a `NullPointerException` and took the scan with it. `IN` never matches NULL, so 
the literal should just be skipped.
   
   Every other reader in that package already does this. 
`globalindex/bitmap/BitmapIndexReader` null-checks inside its own `in` loop, 
and its `equal`, `lessThan`, `greaterThan`, `between`, `notEqual` and `notIn` 
do the same. The guard therefore goes in the same place, in the leaf, and the 
btree reader stops being the odd one out.
   
   The file selector is unaffected: `SortedFileMetaSelector.visitIn` already 
skips nulls when it decides which index files overlap, so a list of only nulls 
selects no file and the result is empty without any special case for it.
   
   ### Tests
   
   `AbstractIndexReaderTest.testInPredicateWithNullLiteral` runs for every 
reader in that hierarchy, so `BTreeIndexReaderTest` and 
`LazyFilteredBTreeIndexReaderTest` both pick it up. It checks the two shapes 
that matter: a list mixing a real key with a null returns exactly the rows for 
the real key, and a list of only nulls returns an empty result.
   
   Against the unfixed reader all 12 template instances of that test fail with 
a `NullPointerException`.
   
   `mvn -pl paimon-common 
-Dtest=BTreeIndexReaderTest,LazyFilteredBTreeIndexReaderTest test` on JDK 8: 
228 tests, 0 failures. `spotless:check` and `checkstyle:check` on paimon-common 
are clean.
   


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