liutang123 opened a new issue, #64800: URL: https://github.com/apache/doris/issues/64800
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version 3.1 maybe 4.0 and 4.1 ### What's Wrong? After enabling the session variable enable_binary_search_filtering_partitions, queries against Hive external catalogs fail with a NullPointerException. Error stack trace: ``` java.lang.NullPointerException: null value in entry: dt=2026-06-22=null at com.google.common.collect.CollectPreconditions.checkEntryNotNull(CollectPreconditions.java:33) at com.google.common.collect.RegularImmutableMap.fromEntryArrayCheckingBucketOverflow(RegularImmutableMap.java:132) at com.google.common.collect.RegularImmutableMap.fromEntryArray(RegularImmutableMap.java:98) at com.google.common.collect.RegularImmutableMap.fromEntries(RegularImmutableMap.java:81) at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:729) at com.google.common.collect.ImmutableMap.copyOf(ImmutableMap.java:702) at org.apache.doris.nereids.trees.plans.logical.LogicalFileScan$SelectedPartitions.<init>(LogicalFileScan.java:173) at org.apache.doris.nereids.rules.rewrite.PruneFileScanPartition.pruneExternalPartitions(PruneFileScanPartition.java:107) at org.apache.doris.nereids.rules.rewrite.PruneFileScanPartition.lambda$build$1(PruneFileScanPartition.java:64) ... ``` Root Cause: In PruneFileScanPartition.java, the SortedPartitionRanges retrieved at partition pruning time differs from the partition list captured at query start — extra partitions (with null values) appear, causing ImmutableMap.copyOf() to throw NullPointerException when constructing SelectedPartitions. ### What You Expected? No NPE. ### How to Reproduce? _No response_ ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
