github-actions[bot] commented on code in PR #68930:
URL: https://github.com/apache/doris/pull/68930#discussion_r4247603974


##########
regression-test/suites/query_p0/condition_cache/test_condition_cache_complex_literal.groovy:
##########
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_condition_cache_complex_literal") {
+    sql "set enable_sql_cache=false"
+    sql "set enable_agg_state=true"
+    sql "drop table if exists condition_cache_complex_literal"
+    sql """
+        create table condition_cache_complex_literal (id int)
+        duplicate key(id)
+        distributed by hash(id) buckets 1
+        properties("replication_num"="1")
+    """
+    sql "insert into condition_cache_complex_literal values (1), (2)"
+
+    def queries = [
+        """
+            select id from condition_cache_complex_literal
+            where bitmap_count(if(id=1, to_bitmap(1), cast(null as bitmap))) > 0
+            order by id
+        """,
+        """
+            select id from condition_cache_complex_literal
+            where bitmap_count(case when id=1 then to_bitmap(1)
+                              else cast(null as bitmap) end) > 0
+            order by id
+        """,
+        """
+            select id from condition_cache_complex_literal
+            where md5sum(X'61', to_binary(cast(id as string))) <> ''
+            order by id
+        """,
+        // FE folds this array into a literal, while the row-dependent index
+        // keeps it in the scan predicate. Even its NULL bitmap element lacks 
xxHash.
+        """
+            select id from condition_cache_complex_literal
+            where bitmap_count(element_at(array(cast(null as bitmap)), id)) = 0
+            order by id
+        """,
+        """
+            select id from condition_cache_complex_literal
+            where element_at(array(cast(null as agg_state<sum(int not 
null)>)), id) is null

Review Comment:
   [P2] Avoid ARRAY<AGG_STATE> in the regression baseline
   
   This query constructs a type that the BE's current Thrift factory cannot 
decode. `ArrayType.toThrift` emits an ARRAY followed by a scalar AGG_STATE, but 
`DataTypeFactory::create_data_type(TTypeDesc, ...)` handles aggregate-state 
metadata only when the root is scalar; the recursive array decoder reaches the 
primitive overload and throws `Nested type should not reach here` for 
TYPE_AGG_STATE. Thus `queries.collect` fails with 
`enable_condition_cache=false` before any enabled-cache comparisons execute. 
Replace this query with a supported type shape, or keep aggregate-state 
coverage in the BE unit test.



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

Reply via email to