This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new fe542241daa branch-4.0: [fix](query cache) fix query cache throw 
'Cannot invoke "String.getBytes(java.nio.charset.Charset)" because "str" is 
null' #59296 (#59333)
fe542241daa is described below

commit fe542241daae21aa6d91dab6d29fc3f39a688ea8
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Dec 25 14:07:18 2025 +0800

    branch-4.0: [fix](query cache) fix query cache throw 'Cannot invoke 
"String.getBytes(java.nio.charset.Charset)" because "str" is null' #59296 
(#59333)
    
    Cherry-picked from #59296
    
    Co-authored-by: 924060929 <[email protected]>
---
 .../PartitionRangePredicateNormalizer.java         |  8 ++-
 .../suites/query_p0/cache/query_cache.groovy       | 66 ++++++++++++++++++++++
 2 files changed, 72 insertions(+), 2 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/planner/normalize/PartitionRangePredicateNormalizer.java
 
b/fe/fe-core/src/main/java/org/apache/doris/planner/normalize/PartitionRangePredicateNormalizer.java
index eceaf9eddd7..04bc1445340 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/planner/normalize/PartitionRangePredicateNormalizer.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/planner/normalize/PartitionRangePredicateNormalizer.java
@@ -34,12 +34,12 @@ import org.apache.doris.catalog.RangePartitionInfo;
 import org.apache.doris.common.Pair;
 import org.apache.doris.planner.OlapScanNode;
 
-import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Range;
 import com.google.common.collect.RangeSet;
 import com.google.common.collect.TreeRangeSet;
 
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
@@ -149,11 +149,15 @@ public class PartitionRangePredicateNormalizer {
     }
 
     private NormalizedPartitionPredicates cannotIntersectPartitionRange() {
+        Map<Long, String> canNotComputeIntersectRange = new LinkedHashMap<>();
+        for (Long selectedPartitionId : 
olapScanNode.getSelectedPartitionIds()) {
+            canNotComputeIntersectRange.put(selectedPartitionId, "");
+        }
         return new NormalizedPartitionPredicates(
                 // conjuncts will be used as the part of the digest
                 olapScanNode.getConjuncts(),
                 // can not compute intersect range
-                
ImmutableMap.of(olapScanNode.getSelectedPartitionIds().iterator().next(), "")
+                canNotComputeIntersectRange
         );
     }
 
diff --git a/regression-test/suites/query_p0/cache/query_cache.groovy 
b/regression-test/suites/query_p0/cache/query_cache.groovy
index 842a1fa3e23..1d699fc8914 100644
--- a/regression-test/suites/query_p0/cache/query_cache.groovy
+++ b/regression-test/suites/query_p0/cache/query_cache.groovy
@@ -192,4 +192,70 @@ GROUP BY col_int_undef_signed;
 
     sql "set enable_nereids_distribute_planner=true"
     test()
+
+
+    multi_sql """
+        drop table if exists query_cache_list_table;
+        CREATE TABLE `query_cache_list_table` (
+          `id` bigint NOT NULL AUTO_INCREMENT(1),
+          `commit_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP ,
+          `data_id` bigint NOT NULL DEFAULT "0" ,
+          `entity_type` varchar(64) NOT NULL DEFAULT "" ,
+          `data_trace_id` bigint NOT NULL DEFAULT "0" ,
+          `action_id` bigint NOT NULL DEFAULT "0" ,
+          `city_code` int NOT NULL DEFAULT "0" ,
+          `source_id` varchar(32) NOT NULL DEFAULT "" ,
+          `property` varchar(128) NOT NULL DEFAULT "" ,
+          `commit_value` varchar(64000) NOT NULL DEFAULT "" ,
+          `quality_score` float NOT NULL DEFAULT "0" ,
+          `ext_info` varchar(1024) NOT NULL DEFAULT "" ,
+          `state` tinyint NOT NULL DEFAULT "1" ,
+          `ctime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ,
+          `mtime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP ,
+          `cuser` bigint NOT NULL DEFAULT "0" ,
+          `muser` bigint NOT NULL DEFAULT "0" 
+        ) ENGINE=OLAP
+        UNIQUE KEY(`id`, `commit_time`, `data_id`, `entity_type`)
+        PARTITION BY LIST (`entity_type`)
+        (PARTITION p_aoi VALUES IN ("AOI"),
+        PARTITION p_loi VALUES IN ("LOI"),
+        PARTITION p_poi VALUES IN ("POI"),
+        PARTITION p_bizcircle VALUES IN ("bizcircle"),
+        PARTITION p_district VALUES IN ("district"),
+        PARTITION p_house VALUES IN ("house"),
+        PARTITION p_nh_block VALUES IN ("nh_block"),
+        PARTITION p_nh_building VALUES IN ("nh_building"),
+        PARTITION p_nh_frame VALUES IN ("nh_frame"),
+        PARTITION p_nh_land VALUES IN ("nh_land"),
+        PARTITION p_nh_project VALUES IN ("nh_project"),
+        PARTITION p_sell_bizcircle VALUES IN ("sell_bizcircle"),
+        PARTITION p_sell_building VALUES IN ("sell_building"),
+        PARTITION p_sell_floor VALUES IN ("sell_floor"),
+        PARTITION p_sell_house VALUES IN ("sell_house"),
+        PARTITION p_sell_resblock VALUES IN ("sell_resblock"),
+        PARTITION p_sell_unit VALUES IN ("sell_unit"))
+        DISTRIBUTED BY HASH(`data_id`) BUCKETS 16
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1",
+        "min_load_replica_num" = "-1",
+        "is_being_synced" = "true",
+        "storage_medium" = "hdd",
+        "storage_format" = "V2",
+        "inverted_index_storage_format" = "V2",
+        "enable_unique_key_merge_on_write" = "true",
+        "light_schema_change" = "true",
+        "disable_auto_compaction" = "false",
+        "binlog.enable" = "true",
+        "binlog.ttl_seconds" = "86400",
+        "binlog.max_bytes" = "9223372036854775807",
+        "binlog.max_history_nums" = "9223372036854775807",
+        "enable_single_replica_compaction" = "false",
+        "group_commit_interval_ms" = "10000",
+        "group_commit_data_bytes" = "134217728",
+        "enable_mow_light_delete" = "false"
+        ); 
+        set disable_nereids_rules=PRUNE_EMPTY_PARTITION;
+        """
+
+    sql "SELECT count(1) FROM query_cache_list_table"
 } 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to