Copilot commented on code in PR #64573:
URL: https://github.com/apache/doris/pull/64573#discussion_r3422051038


##########
regression-test/suites/fault_injection_p0/test_variant_typed_path_bloom_filter.groovy:
##########
@@ -0,0 +1,59 @@
+// 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_typed_path_bloom_filter", "nonConcurrent") {
+    def tableName = "test_variant_typed_path_bloom_filter"
+
+    sql """DROP TABLE IF EXISTS ${tableName}"""
+    sql "set default_variant_enable_doc_mode = false"
+    sql "set enable_common_expr_pushdown = true"

Review Comment:
   The table name is duplicated across multiple statements, which increases the 
chance of inconsistencies when updating the test. Consider introducing a `def 
tableName = 'test_variant_typed_path_bloom_filter'` and interpolating it in SQL 
strings to make future edits safer.



##########
regression-test/suites/fault_injection_p0/test_variant_typed_path_bloom_filter.groovy:
##########
@@ -0,0 +1,59 @@
+// 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_typed_path_bloom_filter", "nonConcurrent") {
+    def tableName = "test_variant_typed_path_bloom_filter"
+
+    sql """DROP TABLE IF EXISTS ${tableName}"""
+    sql "set default_variant_enable_doc_mode = false"
+    sql "set enable_common_expr_pushdown = true"
+    sql """
+        CREATE TABLE ${tableName} (
+            k bigint,
+            v variant<'int_1' : int, properties(
+                "variant_max_subcolumns_count" = "2",
+                "variant_enable_typed_paths_to_sparse" = "false"
+            )>
+        )
+        DUPLICATE KEY(`k`)
+        DISTRIBUTED BY HASH(k) BUCKETS 1
+        properties(
+            "replication_num" = "1",
+            "disable_auto_compaction" = "true",
+            "bloom_filter_columns" = "v"
+        );
+    """
+    sql """
+        INSERT INTO ${tableName} VALUES
+            (1, '{"int_1": 1}'),
+            (2, '{"int_1": 2}'),
+            (3, '{"int_1": 100}'),
+            (4, '{"int_1": 101}');
+    """
+    sql """sync"""
+
+    try {
+        
GetDebugPoint().enableDebugPointForAllBEs("bloom_filter_must_filter_data")
+        def missing = sql """
+            select k from ${tableName}
+            where cast(v['int_1'] as int) = 999
+        """
+        assertEquals(0, missing.size())
+    } finally {
+        
GetDebugPoint().disableDebugPointForAllBEs("bloom_filter_must_filter_data")

Review Comment:
   The table name is duplicated across multiple statements, which increases the 
chance of inconsistencies when updating the test. Consider introducing a `def 
tableName = 'test_variant_typed_path_bloom_filter'` and interpolating it in SQL 
strings to make future edits safer.



##########
regression-test/suites/fault_injection_p0/test_variant_typed_path_bloom_filter.groovy:
##########
@@ -0,0 +1,59 @@
+// 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_typed_path_bloom_filter", "nonConcurrent") {
+    def tableName = "test_variant_typed_path_bloom_filter"
+
+    sql """DROP TABLE IF EXISTS ${tableName}"""

Review Comment:
   These `set` statements mutate session-level variables and aren’t restored, 
which can leak configuration into subsequent suites if the test harness reuses 
the same session/connection. Consider capturing the prior values and restoring 
them in a `try/finally` around the suite body (or explicitly resetting to 
defaults at the end) to keep the test isolated and reduce CI flakiness.



##########
regression-test/suites/fault_injection_p0/test_variant_typed_path_bloom_filter.groovy:
##########
@@ -0,0 +1,59 @@
+// 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_typed_path_bloom_filter", "nonConcurrent") {
+    def tableName = "test_variant_typed_path_bloom_filter"

Review Comment:
   The table name is duplicated across multiple statements, which increases the 
chance of inconsistencies when updating the test. Consider introducing a `def 
tableName = 'test_variant_typed_path_bloom_filter'` and interpolating it in SQL 
strings to make future edits safer.



##########
regression-test/suites/fault_injection_p0/test_variant_typed_path_bloom_filter.groovy:
##########
@@ -0,0 +1,59 @@
+// 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_typed_path_bloom_filter", "nonConcurrent") {
+    def tableName = "test_variant_typed_path_bloom_filter"
+
+    sql """DROP TABLE IF EXISTS ${tableName}"""
+    sql "set default_variant_enable_doc_mode = false"
+    sql "set enable_common_expr_pushdown = true"
+    sql """
+        CREATE TABLE ${tableName} (
+            k bigint,
+            v variant<'int_1' : int, properties(
+                "variant_max_subcolumns_count" = "2",
+                "variant_enable_typed_paths_to_sparse" = "false"
+            )>
+        )
+        DUPLICATE KEY(`k`)
+        DISTRIBUTED BY HASH(k) BUCKETS 1
+        properties(
+            "replication_num" = "1",
+            "disable_auto_compaction" = "true",
+            "bloom_filter_columns" = "v"
+        );
+    """

Review Comment:
   The table name is duplicated across multiple statements, which increases the 
chance of inconsistencies when updating the test. Consider introducing a `def 
tableName = 'test_variant_typed_path_bloom_filter'` and interpolating it in SQL 
strings to make future edits safer.



##########
regression-test/suites/fault_injection_p0/test_variant_typed_path_bloom_filter.groovy:
##########
@@ -0,0 +1,59 @@
+// 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_typed_path_bloom_filter", "nonConcurrent") {
+    def tableName = "test_variant_typed_path_bloom_filter"
+
+    sql """DROP TABLE IF EXISTS ${tableName}"""
+    sql "set default_variant_enable_doc_mode = false"
+    sql "set enable_common_expr_pushdown = true"
+    sql """
+        CREATE TABLE ${tableName} (
+            k bigint,
+            v variant<'int_1' : int, properties(
+                "variant_max_subcolumns_count" = "2",
+                "variant_enable_typed_paths_to_sparse" = "false"
+            )>
+        )
+        DUPLICATE KEY(`k`)
+        DISTRIBUTED BY HASH(k) BUCKETS 1
+        properties(
+            "replication_num" = "1",
+            "disable_auto_compaction" = "true",
+            "bloom_filter_columns" = "v"
+        );
+    """
+    sql """
+        INSERT INTO ${tableName} VALUES
+            (1, '{"int_1": 1}'),
+            (2, '{"int_1": 2}'),
+            (3, '{"int_1": 100}'),
+            (4, '{"int_1": 101}');
+    """
+    sql """sync"""
+

Review Comment:
   The table name is duplicated across multiple statements, which increases the 
chance of inconsistencies when updating the test. Consider introducing a `def 
tableName = 'test_variant_typed_path_bloom_filter'` and interpolating it in SQL 
strings to make future edits safer.



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