From 3fd3ab674cd44ccc2ce64101fbec05241f84880d Mon Sep 17 00:00:00 2001 From: zhangstar333 <2561612514@qq.com> Date: Mon, 16 Oct 2023 14:39:29 +0800 Subject: [PATCH] update case --- .../data/correctness_p0/test_mv_case.out | 7 ++++ ...est_inlineview_with_window_function.groovy | 8 ++-- .../suites/correctness_p0/test_mv_case.groovy | 41 +++++++++++++++++++ 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 regression-test/data/correctness_p0/test_mv_case.out create mode 100644 regression-test/suites/correctness_p0/test_mv_case.groovy diff --git a/regression-test/data/correctness_p0/test_mv_case.out b/regression-test/data/correctness_p0/test_mv_case.out new file mode 100644 index 00000000000000..e87ee694dc1adb --- /dev/null +++ b/regression-test/data/correctness_p0/test_mv_case.out @@ -0,0 +1,7 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !select_default -- +cib2205045_1_1s 2023-06-10T03:55:33 {"DB1":168939,"DNT":"2023-06-10 03:55:33"} +cib2205045_1_1s 2023-06-10T03:56:33 {"DB1":168939,"DNT":"2023-06-10 03:56:33"} +cib2205045_1_1s 2023-06-10T03:57:33 {"DB1":168939,"DNT":"2023-06-10 03:57:33"} +cib2205045_1_1s 2023-06-10T03:58:33 {"DB1":168939,"DNT":"2023-06-10 03:58:33"} + diff --git a/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy b/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy index b179977195c409..fcf71498690cfc 100644 --- a/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy +++ b/regression-test/suites/correctness_p0/test_inlineview_with_window_function.groovy @@ -110,10 +110,10 @@ suite("test_inlineview_with_window_function") { group by ordernum ORDER BY ordernum;""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:55:33','{"DB1":168939,"DNT":"2023-06-10 03:55:33"}') ;""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:56:33','{"DB1":168939,"DNT":"2023-06-10 03:56:33"}') ;""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:57:33','{"DB1":168939,"DNT":"2023-06-10 03:57:33"}') ;""" - sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:58:33','{"DB1":168939,"DNT":"2023-06-10 03:58:33"}') ;""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:55:33','{"DB1":168939,"DNT":"2023-06-10 03:55:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:56:33','{"DB1":168939,"DNT":"2023-06-10 03:56:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:57:33','{"DB1":168939,"DNT":"2023-06-10 03:57:33"}');""" + sql """insert into test_table_aaa values('cib2205045_1_1s','2023/6/10 3:58:33','{"DB1":168939,"DNT":"2023-06-10 03:58:33"}');""" qt_order """select '2023-06-10', diff --git a/regression-test/suites/correctness_p0/test_mv_case.groovy b/regression-test/suites/correctness_p0/test_mv_case.groovy new file mode 100644 index 00000000000000..d8ba37208c988d --- /dev/null +++ b/regression-test/suites/correctness_p0/test_mv_case.groovy @@ -0,0 +1,41 @@ +// 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_mv_case") { + sql """drop table if exists test_table_aaa2;""" + sql """CREATE TABLE `test_table_aaa2` ( + `ordernum` varchar(65533) NOT NULL , + `dnt` datetime NOT NULL , + `data` json NULL + ) ENGINE=OLAP + DUPLICATE KEY(`ordernum`, `dnt`) + COMMENT 'OLAP' + DISTRIBUTED BY HASH(`ordernum`) BUCKETS 3 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1" + );""" + sql """DROP MATERIALIZED VIEW IF EXISTS ods_zn_dnt_max1 ON test_table_aaa2;""" + sql """create materialized view ods_zn_dnt_max1 as + select ordernum,max(dnt) as dnt from test_table_aaa2 + group by ordernum + ORDER BY ordernum;""" + sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:55:33','{"DB1":168939,"DNT":"2023-06-10 03:55:33"}' ;""" + sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:56:33','{"DB1":168939,"DNT":"2023-06-10 03:56:33"}' ;""" + sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:57:33','{"DB1":168939,"DNT":"2023-06-10 03:57:33"}' ;""" + sql """insert into test_table_aaa2 select 'cib2205045_1_1s','2023/6/10 3:58:33','{"DB1":168939,"DNT":"2023-06-10 03:58:33"}' ;""" + qt_select_default """ select * from test_table_aaa2 order by dnt;""" +}