eldenmoon commented on code in PR #63891:
URL: https://github.com/apache/doris/pull/63891#discussion_r3331425608


##########
regression-test/suites/variant_p0/test_variant_array_subscript.groovy:
##########
@@ -0,0 +1,52 @@
+// 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_variant_array_subscript", "p0") {
+    sql "set default_variant_enable_nested_group = false"
+    sql "set default_variant_max_subcolumns_count = 100"
+
+    sql "DROP TABLE IF EXISTS test_variant_array_subscript"
+    sql """
+        CREATE TABLE test_variant_array_subscript (
+            id BIGINT,
+            v VARIANT
+        ) ENGINE=OLAP
+        DUPLICATE KEY(id)
+        DISTRIBUTED BY HASH(id) BUCKETS 1
+        PROPERTIES (
+            "replication_allocation" = "tag.location.default: 1",
+            "disable_auto_compaction" = "true"
+        )
+    """
+
+    sql """
+        INSERT INTO test_variant_array_subscript VALUES
+        (1, '{"items":{"type":["e2e_QC","platform_QC"]}}')
+    """
+    sql "sync"
+
+    order_qt_array_subscript """
+        SELECT id,

Review Comment:
   Thanks, you are right. The result of this plain `VARIANT` array-leaf query 
is already correct on current master, so it is not a good result-based 
regression.
   
   I updated the case to an `explain` regression instead: it now checks 
`subColPath=[items, type]` and verifies the final projection applies the array 
subscript to the pruned slot, rather than keeping the original nested 
`element_at(element_at(...))` chain. I also removed the generated `.out` file 
since the suite no longer uses `order_qt`.



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