924060929 commented on code in PR #9285: URL: https://github.com/apache/incubator-doris/pull/9285#discussion_r860517111
########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_int_nullable.groovy: ########## @@ -0,0 +1,189 @@ +// 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_dup_tab_basic_int_nullable") { + + def table1 = "test_dup_tab_basic_int_tab_nullable" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` int(11) NULL COMMENT "", + `citycode` int(11) NULL COMMENT "", + `userid` int(11) NULL COMMENT "", + `pv` int(11) NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) +""" + + sql "insert into ${table1} values(9,10,11,12)" + sql "insert into ${table1} values(9,10,11,12)" + sql "insert into ${table1} values(21,null,23,null)" + sql "insert into ${table1} values(1,2,3,4)" + sql "insert into ${table1} values(1,2,3,4)" + sql "insert into ${table1} values(13,14,15,16)" + sql "insert into ${table1} values(13,21,22,16)" + sql "insert into ${table1} values(13,14,15,16)" + sql "insert into ${table1} values(13,21,22,16)" + sql "insert into ${table1} values(17,18,19,20)" + sql "insert into ${table1} values(17,18,19,20)" + sql "insert into ${table1} values(null,21,null,23)" + sql "insert into ${table1} values(22,null,24,25)" + sql "insert into ${table1} values(26,27,null,29)" + sql "insert into ${table1} values(5,6,7,8)" + sql "insert into ${table1} values(5,6,7,8)" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_varchar_nullable.groovy: ########## @@ -0,0 +1,110 @@ +// 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_dup_tab_basic_varchar_nullable") { + + def table1 = "test_dup_tab_basic_varchar_nullable_tab" + + sql "drop table if exists ${table1}" + + sql """ + CREATE TABLE `${table1}` ( + `city` varchar(20) NULL COMMENT "", + `name` varchar(20) NULL COMMENT "", + `addr` varchar(20) NULL COMMENT "", + `compy` varchar(20) NULL COMMENT "" + ) ENGINE=OLAP + DUPLICATE KEY(`city`) + COMMENT "OLAP" + DISTRIBUTED BY HASH(`city`) BUCKETS 1 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2" + ) + """ + sql "insert into ${table1} values(null,'qie3','yy','lj')" + sql "insert into ${table1} values(null,'hehe',null,'lala')" + sql "insert into ${table1} values('beijing','xuanwu','wugui',null)" + sql "insert into ${table1} values('beijing','fengtai','fengtai1','fengtai2')" + sql "insert into ${table1} values('beijing','chaoyang','wangjing','donghuqu')" + sql "insert into ${table1} values('shanghai','hehe',null,'haha')" + sql "insert into ${table1} values('tengxun','qie','gg','lj')" + sql "insert into ${table1} values('tengxun2','qie',null,'lj')" + Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_date.groovy: ########## @@ -0,0 +1,65 @@ +// 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_dup_tab_date") { + + def table1 = "test_dup_tab_date" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` int(11) NOT NULL COMMENT "", + `date1` date NOT NULL COMMENT "", + `date2` date NOT NULL COMMENT "", + `date3` date NOT NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + """ + + sql "insert into ${table1} values(1, '2021-04-01', '2021-04-02', '2021-04-03')" + sql "insert into ${table1} values(1, '2021-03-01', '2021-03-02', '2021-03-03')" + sql "insert into ${table1} values(1, '2021-02-01', '2021-02-02', '2021-02-03')" + sql "insert into ${table1} values(1, '2021-01-01', '2021-01-02', '2021-01-03')" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_mixed_type_nullable.groovy: ########## @@ -0,0 +1,100 @@ +// 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_dup_tab_mixed_type_nullable") { + + def table1 = "test_dup_tab_mixed_type_nullable_tab" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` int(11) NULL COMMENT "", + `cardid` int(11) NULL COMMENT "", + `low` double NULL COMMENT "", + `high` double NULL COMMENT "", + `cash1` decimal(10, 5) NULL COMMENT "", + `cash2` decimal(10, 5) NULL COMMENT "", + `name` varchar(20) NULL COMMENT "", + `addr` varchar(20) NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) +""" + + sql "insert into ${table1} values(1,2,3.1,4.2,5.3,5.4,'a1','a2')" + sql "insert into ${table1} values(2,3,4.1,5.2,6.3,7.4,'b1','b2')" + sql "insert into ${table1} values(3,4,5.1,6.2,7.3,8.4,'c1','c2')" + sql "insert into ${table1} values(4,5,6.1,7.2,8.3,9.4,'d1','d2')" + sql "insert into ${table1} values(5,6,7.1,8.2,9.3,10.4,'d1','e2')" + sql "insert into ${table1} values(5,6,5.1,8.2,6.3,11.4,'e1','e2')" + sql "insert into ${table1} values(null,7,null,8,null,9,null,'e3')" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_mixed_type.groovy: ########## @@ -0,0 +1,93 @@ +// 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_dup_tab_mixed_type") { + + def table1 = "test_dup_tab_mixed_type_tab" + + sql "drop table if exists ${table1}" + + sql """ + +CREATE TABLE `${table1}` ( + `siteid` int(11) NOT NULL COMMENT "", + `cardid` int(11) NOT NULL COMMENT "", + `low` double NOT NULL COMMENT "", + `high` double NOT NULL COMMENT "", + `cash1` decimal(10, 5) NOT NULL COMMENT "", + `cash2` decimal(10, 5) NOT NULL COMMENT "", + `name` varchar(20) NOT NULL COMMENT "", + `addr` varchar(20) NOT NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + """ + + sql "insert into ${table1} values(1,2,3.1,4.2,5.3,5.4,'a1','a2')" + sql "insert into ${table1} values(2,3,4.1,5.2,6.3,7.4,'b1','b2')" + sql "insert into ${table1} values(3,4,5.1,6.2,7.3,8.4,'c1','c2')" + sql "insert into ${table1} values(4,5,6.1,7.2,8.3,9.4,'d1','d2')" + sql "insert into ${table1} values(5,6,5.1,8.2,6.3,11.4,'e1','e2')" + sql "insert into ${table1} values(5,6,7.1,8.2,9.3,10.4,'d1','e2')" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_int.groovy: ########## @@ -0,0 +1,154 @@ +// 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_dup_tab_basic_int") { + + def table1 = "test_dup_tab_basic_int_tab" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` int(11) NOT NULL COMMENT "", + `citycode` int(11) NOT NULL COMMENT "", + `userid` int(11) NOT NULL COMMENT "", + `pv` int(11) NOT NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + +""" + sql "insert into ${table1} values(9,10,11,12)" + sql "insert into ${table1} values(9,10,11,12)" + sql "insert into ${table1} values(1,2,3,4)" + sql "insert into ${table1} values(13,21,22,16)" + sql "insert into ${table1} values(13,14,15,16)" + sql "insert into ${table1} values(17,18,19,20)" + sql "insert into ${table1} values(1,2,3,4)" + sql "insert into ${table1} values(13,21,22,16)" + sql "insert into ${table1} values(13,14,15,16)" + sql "insert into ${table1} values(17,18,19,20)" + sql "insert into ${table1} values(5,6,7,8)" + sql "insert into ${table1} values(5,6,7,8)" Review Comment: suggest insert into multiple rows in a sql ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_basic_varchar.groovy: ########## @@ -0,0 +1,117 @@ +// 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_dup_tab_basic_varchar") { + + def table1 = "test_dup_tab_basic_varchar_tab" + + sql "drop table if exists ${table1}" + + sql """ + CREATE TABLE `${table1}` ( + `city` varchar(20) NOT NULL COMMENT "", + `name` varchar(20) NOT NULL COMMENT "", + `addr` varchar(20) NOT NULL COMMENT "", + `compy` varchar(20) NOT NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`city`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`city`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + """ + + sql "insert into ${table1} values('a1','a2','a3','a4')" + sql "insert into ${table1} values('b1','b2','b3','b4')" + sql "insert into ${table1} values('c1','f1','d3','f4')" + sql "insert into ${table1} values('c1','c2','c3','c4')" + sql "insert into ${table1} values('d1','d2','d3','d4')" + sql "insert into ${table1} values('e1','e2','e3','e4')" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_decimal.groovy: ########## @@ -0,0 +1,122 @@ +// 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_dup_tab_decimal") { + + def table1 = "test_dup_tab_decimal" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` decimal(10, 5) NOT NULL COMMENT "", + `citycode` decimal(10, 5) NOT NULL COMMENT "", + `userid` decimal(10, 5) NOT NULL COMMENT "", + `pv` decimal(10, 5) NOT NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + """ + + sql "insert into ${table1} values(1.1,2.2,2.3,3.4)" + sql "insert into ${table1} values(1.1,1.2,1.3,1.4)" + sql "insert into ${table1} values(2.1,2.2,2.3,2.4)" + sql "insert into ${table1} values(3.1,3.2,3.3,3.4)" + sql "insert into ${table1} values(4.1,4.2,4.3,4.4)" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_decimal_nullable.groovy: ########## @@ -0,0 +1,125 @@ +// 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_dup_tab_decimal_nullable") { + + def table1 = "test_dup_tab_decimal_nullable" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` decimal(10, 5) NULL COMMENT "", + `citycode` decimal(10, 5) NULL COMMENT "", + `userid` decimal(10, 5) NULL COMMENT "", + `pv` decimal(10, 5) NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + """ + + sql "insert into ${table1} values(1.1,1.2,1.3,1.4)" + sql "insert into ${table1} values(1.1,2.2,2.3,3.4)" + sql "insert into ${table1} values(2.1,2.2,2.3,2.4)" + sql "insert into ${table1} values(3.1,3.2,3.3,3.4)" + sql "insert into ${table1} values(4.1,4.2,4.3,4.4)" + sql "insert into ${table1} values(null,2,null,4)" Review Comment: ditto ########## regression-test/suites/data_model/duplicate/storage/test_dup_tab_date_nullable.groovy: ########## @@ -0,0 +1,71 @@ +// 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_dup_tab_date_nullable") { + + def table1 = "test_dup_tab_date_nullable" + + sql "drop table if exists ${table1}" + + sql """ +CREATE TABLE `${table1}` ( + `siteid` int(11) NULL COMMENT "", + `date1` date NULL COMMENT "", + `date2` date NULL COMMENT "", + `date3` date NULL COMMENT "" +) ENGINE=OLAP +DUPLICATE KEY(`siteid`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`siteid`) BUCKETS 1 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + + """ + + sql "insert into ${table1} values(1, '2021-04-01', '2021-04-02', '2021-04-03')" + sql "insert into ${table1} values(1, '2021-03-01', '2021-03-02', '2021-03-03')" + sql "insert into ${table1} values(1, '2021-02-01', '2021-02-02', '2021-02-03')" + sql "insert into ${table1} values(1, '2021-01-01', '2021-01-02', '2021-01-03')" + sql "insert into ${table1} values(null, '2021-05-01', 'null', '2021-04-03')" Review Comment: ditto -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org