Skip to content

Commit

Permalink
fix-rt
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Sep 10, 2024
1 parent 2535ddd commit db6fc9f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
26 changes: 14 additions & 12 deletions regression-test/suites/point_query_p0/test_rowstore.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,10 @@ suite("test_rowstore", "p0,nonConcurrent") {
"""
sql "select /*+ SET_VAR(enable_nereids_planner=true)*/ * from table_with_column_group where k1 = 1"

def tableName = "rs_query"
sql """DROP TABLE IF EXISTS ${tableName}"""
sql """DROP TABLE IF EXISTS rs_query"""
sql "set enable_decimal256 = true"
sql """
CREATE TABLE IF NOT EXISTS ${tableName} (
CREATE TABLE IF NOT EXISTS rs_query (
`k1` int(11) NULL COMMENT "",
`v1` text NULL COMMENT "",
`v2` DECIMAL(50, 18) NULL COMMENT ""
Expand All @@ -303,26 +302,29 @@ suite("test_rowstore", "p0,nonConcurrent") {
)
"""

sql """insert into ${tableName} values (1, 'abc', 1111919.12345678919)"""
sql """
insert into rs_query values (1, 'abc', 1111919.12345678919), (2, 'abc', 1111919.12345678919);
analyze table rs_query with sync;
"""
explain {
sql("select * from ${tableName} order by k1 limit 1")
sql("select * from rs_query order by k1 limit 1")
contains "TOPN OPT"
}
qt_sql """select * from ${tableName} order by k1 limit 1"""
qt_sql """select * from rs_query order by k1 limit 1"""

sql """
ALTER table ${tableName} ADD COLUMN new_column1 INT default "123";
ALTER table rs_query ADD COLUMN new_column1 INT default "123";
"""
qt_sql """select * from ${tableName} where k1 = 1"""
qt_sql """select * from rs_query where k1 = 1"""

sql """
ALTER table ${tableName} ADD COLUMN new_column2 DATETIMEV2(3) DEFAULT "1970-01-01 00:00:00.111";
ALTER table rs_query ADD COLUMN new_column2 DATETIMEV2(3) DEFAULT "1970-01-01 00:00:00.111";
"""
sleep(1000)
qt_sql """select * from ${tableName} where k1 = 1"""
qt_sql """select * from rs_query where k1 = 1"""

sql """insert into ${tableName} values (2, 'def', 1111919.12345678919, 456, NULL)"""
qt_sql """select * from ${tableName} where k1 = 2"""
sql """insert into rs_query values (2, 'def', 1111919.12345678919, 456, NULL)"""
qt_sql """select * from rs_query where k1 = 2"""

sql "set global enable_short_circuit_query_access_column_store = false"
test {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
// under the License.

suite("test_map_select_with_limit", "query") {
// define a sql table
def testTable = "test_map_select_with_limit"

sql """
CREATE TABLE IF NOT EXISTS ${testTable} (
CREATE TABLE IF NOT EXISTS test_map_select_with_limit (
`k1` INT(11) NULL,
`k2` MAP<SMALLINT(6), STRING> NULL
) ENGINE=OLAP
Expand All @@ -35,15 +32,18 @@ suite("test_map_select_with_limit", "query") {
)
"""
// prepare data
sql """ INSERT INTO ${testTable} VALUES (100, {1: "amory", 2: "is", 3: "better"}) """
sql """
INSERT INTO test_map_select_with_limit VALUES (100, {1: "amory", 2: "is", 3: "better"}), (101, {1: "amory", 2: "is", 3: "better"});
analyze table test_map_select_with_limit with sync;
"""
// set topn_opt_limit_threshold = 1024 to make sure _internal_service to be request with proto request
sql """ set topn_opt_limit_threshold = 1024 """

explain{
sql("select * from ${testTable} order by k1 limit 1")
sql("select * from test_map_select_with_limit order by k1 limit 1")
contains "TOPN"
}


qt_select """ select * from ${testTable} order by k1 limit 1 """
}
qt_select """ select * from test_map_select_with_limit order by k1 limit 1 """
}

0 comments on commit db6fc9f

Please sign in to comment.