forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[regression](lateral view) add test case for explode_bitmap
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,3 +127,11 @@ | |
1 a u1 10 1 | ||
3 a u1 10 3 | ||
|
||
-- !sql_explode_bitmap -- | ||
1 1 | ||
1 2 | ||
1 3 | ||
2 22 | ||
2 33 | ||
2 44 | ||
|
17 changes: 17 additions & 0 deletions
17
regression-test/data/query_p0/lateral_view/lateral_view.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !sql_explode_bitmap0 -- | ||
1 1 | ||
1 2 | ||
1 3 | ||
2 22 | ||
2 33 | ||
2 44 | ||
|
||
-- !sql_explode_bitmap1 -- | ||
1 1 | ||
1 2 | ||
1 3 | ||
2 22 | ||
2 33 | ||
2 44 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
regression-test/suites/query_p0/lateral_view/lateral_view.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// 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("lateral_view") { | ||
sql """ DROP TABLE IF EXISTS `test_explode_bitmap` """ | ||
sql """ | ||
CREATE TABLE `test_explode_bitmap` ( | ||
`dt` int(11) NULL COMMENT "", | ||
`page` varchar(10) NULL COMMENT "", | ||
`user_id` bitmap BITMAP_UNION NULL COMMENT "" | ||
) ENGINE=OLAP | ||
AGGREGATE KEY(`dt`, `page`) | ||
DISTRIBUTED BY HASH(`dt`) BUCKETS 2 | ||
properties("replication_num"="1"); | ||
""" | ||
sql """ insert into test_explode_bitmap values(1, '11', bitmap_from_string("1,2,3"));""" | ||
sql """ insert into test_explode_bitmap values(2, '22', bitmap_from_string("22,33,44"));""" | ||
|
||
sql "SET enable_nereids_planner=false" | ||
qt_sql_explode_bitmap0 """ select dt, e1 from test_explode_bitmap lateral view explode_bitmap(user_id) tmp1 as e1 order by dt, e1;""" | ||
|
||
sql "SET enable_nereids_planner=true" | ||
qt_sql_explode_bitmap1 """ select dt, e1 from test_explode_bitmap lateral view explode_bitmap(user_id) tmp1 as e1 order by dt, e1;""" | ||
} |