Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test](case) add insert into with tablet sink shuffle case #44215

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions regression-test/data/insert_p0/test_insert_tablet_sink.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !select --
1 170141183460469231731687303715884105727
2 -170141183460469231731687303715884105728
3 333
4 444
5 555
6 666

-- !select --
1 170141183460469231731687303715884105727
2 -170141183460469231731687303715884105728
3 333
3 333
4 444
4 444
5 555
5 555
6 666
6 666

70 changes: 70 additions & 0 deletions regression-test/suites/insert_p0/test_insert_tablet_sink.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// 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_insert_tablet_sink") {
sql """drop table if exists `table_largeint`;"""
sql """drop table if exists `tmp_varchar`;"""

sql """
CREATE TABLE `tmp_varchar` (
`k1` bigint(20) not NULL,
`c_varchar` varchar(65533) not NULL
) ENGINE=OLAP
UNIQUE KEY(`k1`, c_varchar)
COMMENT 'OLAP'
AUTO PARTITION BY list (c_varchar) ()
DISTRIBUTED BY HASH(`k1`) BUCKETS 10
PROPERTIES("replication_num" = "1");
"""

sql """
CREATE TABLE `table_largeint` (
`k1` bigint(20) not NULL,
`c_largeint` largeint not NULL,
str string null
) ENGINE=OLAP
UNIQUE KEY(`k1`, c_largeint)
COMMENT 'OLAP'
AUTO PARTITION BY list (c_largeint) ()
DISTRIBUTED BY HASH(`k1`) BUCKETS 10
PROPERTIES("replication_num" = "1");

"""

sql """insert into tmp_varchar values(1, "170141183460469231731687303715884105727")"""
sql """insert into tmp_varchar values(2, "-170141183460469231731687303715884105728")"""
sql """insert into tmp_varchar values(3,'333');"""
sql """insert into tmp_varchar values(4,'444');"""
sql """insert into tmp_varchar values(5,'555');"""
sql """insert into tmp_varchar values(6,'666');"""

qt_select """select * from tmp_varchar order by 1;"""

sql """ set skip_delete_bitmap = true; """
sql """ set enable_memtable_on_sink_node = true; """
sql """ set parallel_pipeline_task_num = 2; """


sql """ insert into table_largeint select k1,c_varchar,cast(rand() * 50000000 as bigint) from tmp_varchar where k1>=3; """
explain {
sql "insert into table_largeint select k1,c_varchar,cast(rand() * 50000000 as bigint) from tmp_varchar;"
contains "TABLET_SINK_SHUFFLE_PARTITIONED"
}

sql """ insert into table_largeint select k1,c_varchar,cast(rand() * 50000000 as bigint) from tmp_varchar; """
qt_select """select k1,c_largeint from table_largeint order by 1;"""
}
Loading