forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
267 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !q01 -- | ||
10 1 | ||
|
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,13 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !q03 -- | ||
Albania | ||
Azerbaijan | ||
Christmas Island | ||
Cote d'Ivoire | ||
Mexico | ||
Pitcairn Island | ||
Switzerland | ||
Syria | ||
United States Virgin Islands | ||
Uzbekistan | ||
|
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,13 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !q04 -- | ||
\N 0 | ||
Antarctica 1 | ||
Ascension Island 1 | ||
Cook Islands 1 | ||
Equatorial Guinea 1 | ||
Micronesia 1 | ||
Montserrat 1 | ||
Paraguay 1 | ||
Sao Tome and Principe 1 | ||
Saudia Arabia 1 | ||
|
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,13 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !q05 -- | ||
Albania Sao Tome and Principe Sao Tome and Principe | ||
Azerbaijan \N \N | ||
Christmas Island Equatorial Guinea Equatorial Guinea | ||
Cote d'Ivoire Ascension Island Ascension Island | ||
Mexico Antarctica Antarctica | ||
Pitcairn Island Micronesia Micronesia | ||
Switzerland Montserrat Montserrat | ||
Syria Saudia Arabia Saudia Arabia | ||
United States Virgin Islands Cook Islands Cook Islands | ||
Uzbekistan Paraguay Paraguay | ||
|
17 changes: 17 additions & 0 deletions
17
regression-test/suites/usercases/OPPO/ddl/ads_tag_position_store_distance_all_d.sql
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 @@ | ||
CREATE TABLE `ads_tag_position_store_distance_all_d` | ||
( | ||
`one_id` varchar(200) NULL COMMENT "oneid", | ||
`dayno` int(11) NULL COMMENT "时间分区", | ||
`imei` varchar(100) NULL COMMENT "imei", | ||
`ssoid` varchar(100) NULL COMMENT "ssoid", | ||
`country_code` varchar(100) NULL COMMENT "国际区号,如+86", | ||
`union_id` varchar(100) NULL COMMENT "union id", | ||
`union_id_dic_id` bigint(20) NULL COMMENT "union_id生成的字典ID", | ||
`ext` varchar(100) NULL COMMENT "拓展字段", | ||
`etl_time` varchar(100) NULL COMMENT "时间戳" | ||
) ENGINE=OLAP | ||
DUPLICATE KEY(`one_id`) | ||
DISTRIBUTED BY HASH(`one_id`) BUCKETS 12 | ||
PROPERTIES ( | ||
"replication_num" = "1" | ||
); |
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,45 @@ | ||
// 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. | ||
|
||
// The cases is copied from https://github.com/trinodb/trino/tree/master | ||
// /testing/trino-product-tests/src/main/resources/sql-tests/testcases/tpcds | ||
// and modified by Doris. | ||
suite("load") { | ||
def tables = | ||
[ | ||
"ads_tag_position_store_distance_all_d" | ||
] | ||
for (String table in tables) { | ||
sql """DROP TABLE IF EXISTS ${table}""" | ||
sql new File("""${context.file.parent}/ddl/${table}.sql""").text | ||
} | ||
|
||
sql """ | ||
INSERT INTO ads_tag_position_store_distance_all_d (one_id,dayno,imei,ssoid,country_code,union_id,union_id_dic_id,ext,etl_time) VALUES | ||
('Central African Republic',7,'Switzerland','Mozambique','Montserrat','Algeria',6,'Iraq','Malta'), | ||
('Russia',7,'Albania','Greenland','Sao Tome and Principe','Saint Martin',1,'Spain','Micronesia'), | ||
('Saudia Arabia',9,'Pitcairn Island','Georgia','Micronesia','United States of America',10,'Iceland','Georgia'), | ||
('Sao Tome and Principe',4,'Azerbaijan','Guinea',NULL,'Portugal',1,'Angola','Libya'), | ||
('Afghanistan',3,'United States Virgin Islands','Kyrgyzstan','Cook Islands','Western Sahara',6,'Turkey','Timor-Leste'), | ||
('Bahamas',8,'Christmas Island','Moldova','Equatorial Guinea','Sweden',8,'Senegal','Eritrea'), | ||
('Botswana',6,'Syria','Tunisia','Saudia Arabia','Czech Republic',9,'France','US Minor Outlying Islands'), | ||
('Senegal',4,'Cote d''Ivoire','Estonia','Ascension Island','Fiji',10,'Myanmar','Bouvet Island'), | ||
('Syria',4,'Uzbekistan','Dominican Republic','Paraguay','Guam',1,'French Polynesia','Malaysia'), | ||
('Haiti',6,'Mexico','Seychelles','Antarctica','Hungary',2,'Bangladesh','Saint Lucia'); | ||
""" | ||
} | ||
|
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,3 @@ | ||
select union_id_dic_id, ROW_NUMBER() OVER (order by union_id_dic_id) as rownum | ||
from ads_tag_position_store_distance_all_d | ||
where dayno = (select max(dayno) from ads_tag_position_store_distance_all_d); |
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,118 @@ | ||
-- select | ||
-- bitmap_count(bitmap_and( ( | ||
-- select | ||
-- bitmap_and(( | ||
-- select | ||
-- bitmap_and(( | ||
-- select | ||
-- bitmap_and(( | ||
-- select | ||
-- bitmap_union(to_bitmap(a1.ssoid)) as a1_ssoid | ||
-- from | ||
-- ( | ||
-- select | ||
-- one_id , | ||
-- imei , | ||
-- ssoid , | ||
-- country_code , | ||
-- union_id | ||
-- from | ||
-- ads_tag_position_store_distance_all_d | ||
-- where | ||
-- dayno = ( | ||
-- select | ||
-- max(dayno) | ||
-- from | ||
-- ads_tag_position_store_distance_all_d) | ||
-- ) a1 | ||
-- where | ||
-- a1.ssoid is not null | ||
-- and a1.ssoid != ''), | ||
-- ( | ||
-- select | ||
-- bitmap_union(to_bitmap(a2.ssoid)) as a2_ssoid | ||
-- from | ||
-- ( | ||
-- select | ||
-- one_id , | ||
-- imei , | ||
-- ssoid , | ||
-- country_code , | ||
-- union_id | ||
-- from | ||
-- ads_tag_position_store_distance_all_d | ||
-- where | ||
-- dayno = ( | ||
-- select | ||
-- max(dayno) | ||
-- from | ||
-- ads_tag_position_store_distance_all_d)) a2 | ||
-- where | ||
-- a2.ssoid is not null | ||
-- and a2.ssoid != ''))), | ||
-- ( | ||
-- select | ||
-- bitmap_union(to_bitmap(a3.ssoid)) as a3_ssoid | ||
-- from | ||
-- ( | ||
-- select | ||
-- one_id , | ||
-- imei , | ||
-- ssoid , | ||
-- country_code , | ||
-- union_id | ||
-- from | ||
-- ads_tag_position_store_distance_all_d | ||
-- where | ||
-- dayno = ( | ||
-- select | ||
-- max(dayno) | ||
-- from | ||
-- ads_tag_position_store_distance_all_d)) a3 | ||
-- where | ||
-- a3.ssoid is not null | ||
-- and a3.ssoid != ''))), | ||
-- ( | ||
-- select | ||
-- bitmap_union(to_bitmap(a4.ssoid)) as a4_ssoid | ||
-- from | ||
-- ( | ||
-- select | ||
-- one_id , | ||
-- imei , | ||
-- ssoid , | ||
-- country_code , | ||
-- union_id | ||
-- from | ||
-- ads_tag_position_store_distance_all_d | ||
-- where | ||
-- dayno = ( | ||
-- select | ||
-- max(dayno) | ||
-- from | ||
-- ads_tag_position_store_distance_all_d)) a4 | ||
-- where | ||
-- a4.ssoid is not null | ||
-- and a4.ssoid != ''))), | ||
-- ( | ||
-- select | ||
-- bitmap_union(to_bitmap(a5.ssoid)) as a5_ssoid | ||
-- from | ||
-- ( | ||
-- select | ||
-- one_id , | ||
-- imei , | ||
-- ssoid , | ||
-- country_code , | ||
-- union_id | ||
-- from | ||
-- ads_tag_position_store_distance_all_d | ||
-- where | ||
-- dayno = ( | ||
-- select | ||
-- max(dayno) | ||
-- from | ||
-- ads_tag_position_store_distance_all_d)) a5 | ||
-- where | ||
-- a5.ssoid is not null | ||
-- and a5.ssoid != ''))) |
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,21 @@ | ||
select a1.imei | ||
from (select imei | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null | ||
and imei != '') a1 | ||
left join (select imei | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null | ||
and imei != '') a2 | ||
on a1.imei = a2.imei | ||
left join (select imei | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null | ||
and imei != '') a3 | ||
on a1.imei = a3.imei | ||
left join (select imei | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null | ||
and imei != '') a4 | ||
on a1.imei = a4.imei | ||
order by imei |
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,10 @@ | ||
select country_code, count(country_code) as cnt | ||
from (select a1.imei, a2.country_code | ||
from (select imei | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null and imei != '') a1 | ||
left join (select imei,country_code | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null and imei != '') a2 on a1.imei = a2.imei) t | ||
group by country_code | ||
order by country_code |
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,10 @@ | ||
select a1.imei, a1.country_code, a2.country_code | ||
from (select imei, country_code | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null | ||
and imei != '') a1 | ||
left join (select imei, country_code | ||
from ads_tag_position_store_distance_all_d | ||
where imei is not null | ||
and imei != '') a2 on a1.imei = a2.imei | ||
order by imei limit 100 |