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


##########
regression-test/suites/variant_p0/variant_compute_v2.groovy:
##########
@@ -18,8 +18,56 @@
 suite("variant_compute_v2", "p0,nonConcurrent") {
     sql "SET enable_nereids_planner = true"
     sql "SET enable_fallback_to_original_planner = false"
+    def segmentScanTable = "variant_v2_segment_scan"
+    sql "DROP TABLE IF EXISTS ${segmentScanTable}"
+    sql """
+        CREATE TABLE ${segmentScanTable} (
+            id INT,
+            v VARIANT<PROPERTIES("variant_max_subcolumns_count" = "2")> NULL
+        )
+        DUPLICATE KEY(id)
+        DISTRIBUTED BY HASH(id) BUCKETS 1
+        PROPERTIES("replication_num" = "1")
+    """
+
+    // Storage writes remain on ColumnVariant. The same segment is scanned 
into ColumnVariantV2
+    // after the session switch below.
+    sql "SET enable_variant_v2 = false"
+    sql """
+        INSERT INTO ${segmentScanTable} VALUES
+        (0, '{"dense":1,"nested":{"value":"a"},"sparse":100}'),
+        (1, '{"dense":2,"nested":{"value":"b"}}'),
+        (2, '{"dense":3,"nested":{"value":"c"},"sparse":300}'),
+        (3, NULL)
+    """
     sql "SET enable_variant_v2 = true"
 
+    order_qt_segment_scan """
+        SELECT id, CAST(v AS STRING), v IS NULL
+        FROM ${segmentScanTable}
+        ORDER BY id
+    """
+
+    order_qt_segment_scan_subpaths """
+        SELECT id,
+               CAST(v['dense'] AS BIGINT),
+               CAST(v['nested']['value'] AS STRING),
+               CAST(v['sparse'] AS BIGINT)
+        FROM ${segmentScanTable}
+        ORDER BY id
+    """
+
+    // variant_type accepts legacy ColumnVariant, but deliberately rejects 
ColumnVariantV2.

Review Comment:
   更新:新 head `d694272` 已在 `function_variant_type.cpp:146-268` 实现 
ColumnVariantV2,并在 `variant_p0/v2/variant_compute_v2.groovy:61-65` 改成正向结果;但这里的旧 
suite 仍期待同一调用抛错。因此这已经不是未来维护性风险,而是当前 head 下两个同名 suite 的确定性契约冲突。请删除/迁移旧 
case,并避免同时保留两份 `suite("variant_compute_v2")`。



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