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

jianliangqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b63f00987f0 [regression](invered index) add test null index case and 
fix fault injection index case (#27265)
b63f00987f0 is described below

commit b63f00987f0b439b42ca334fda456f82219dcc1c
Author: airborne12 <[email protected]>
AuthorDate: Tue Nov 21 14:04:57 2023 +0800

    [regression](invered index) add test null index case and fix fault 
injection index case (#27265)
---
 .../test_index_fault_injection.out                 |  0
 .../inverted_index_p0/test_null_index.out}         |  5 +-
 .../inverted_index_p0/test_null_index.groovy       | 56 ++++++++++++++++++++++
 3 files changed, 60 insertions(+), 1 deletion(-)

diff --git 
a/regression-test/suites/fault_injection_p0/test_index_fault_injection.out 
b/regression-test/data/fault_injection_p0/test_index_fault_injection.out
similarity index 100%
copy from 
regression-test/suites/fault_injection_p0/test_index_fault_injection.out
copy to regression-test/data/fault_injection_p0/test_index_fault_injection.out
diff --git 
a/regression-test/suites/fault_injection_p0/test_index_fault_injection.out 
b/regression-test/data/inverted_index_p0/test_null_index.out
similarity index 72%
rename from 
regression-test/suites/fault_injection_p0/test_index_fault_injection.out
rename to regression-test/data/inverted_index_p0/test_null_index.out
index a21f3b8748e..e37dc33ca03 100644
--- a/regression-test/suites/fault_injection_p0/test_index_fault_injection.out
+++ b/regression-test/data/inverted_index_p0/test_null_index.out
@@ -1,4 +1,7 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !sql --
-0
 
+-- !sql --
+1      a       \N      [null]  [1]
+
+-- !sql --
diff --git a/regression-test/suites/inverted_index_p0/test_null_index.groovy 
b/regression-test/suites/inverted_index_p0/test_null_index.groovy
new file mode 100644
index 00000000000..6bbab71e940
--- /dev/null
+++ b/regression-test/suites/inverted_index_p0/test_null_index.groovy
@@ -0,0 +1,56 @@
+// 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_null_index", "p0"){
+    // prepare test table
+
+
+    def timeout = 60000
+    def delta_time = 1000
+    def alter_res = "null"
+    def useTime = 0
+
+    def indexTblName = "no_index_test"
+
+    sql "DROP TABLE IF EXISTS ${indexTblName}"
+    // create 1 replica table
+    sql """
+       CREATE TABLE IF NOT EXISTS ${indexTblName}(
+           `id` int(11) NOT NULL,
+           `str` string NOT NULL,
+           `str_null` string NULL,
+            `value` array<text> NOT NULL,
+            `value_int` array<int> NOT NULL
+       ) ENGINE=OLAP
+       DUPLICATE KEY(`id`)
+       COMMENT 'OLAP'
+       DISTRIBUTED BY HASH(`id`) BUCKETS 1
+       PROPERTIES(
+           "replication_allocation" = "tag.location.default: 1"
+       );
+    """
+    
+    sql "INSERT INTO $indexTblName VALUES (1, 'a', null, [null], [1]), (2, 
'b', 'b', ['b'], [2]), (3, 'c', 'c', ['c'], [3]);"
+    qt_sql "SELECT * FROM $indexTblName WHERE str match null order by id;"
+    qt_sql "SELECT * FROM $indexTblName WHERE str_null match null order by id;"
+    try {
+        qt_sql "SELECT * FROM $indexTblName WHERE value_int element_eq 2;"
+    } catch (Exception e) {
+        assertTrue(e.getMessage().contains("unsupported nested array of 
type"), e.getMessage())
+    }
+}


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

Reply via email to