Skip to content

Commit f83a79e

Browse files
lsy3993zy-kkk
andauthored
add user case for zhong_guo_yi_dong (apache#190)
# Checklist * 内部Jira:http://jira.selectdb.com:8090/browse/CIR-1733 * 修复PR:apache#17537 * master: * 1.2-lts: * 1.2-lts: * Doris-master: * [x] 已修复 * [ ] 未修复 * [ ] 无问题 * Doris-1.2-lts: * [x] 已修复 * [ ] 未修复 * [ ] 无问题 * Doris-1.1-lts: * [ ] 已修复 * [ ] 未修复 * [ ] 无问题 --------- Co-authored-by: yongkang.zhong <[email protected]>
1 parent cfbf303 commit f83a79e

4 files changed

Lines changed: 63 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- This file is automatically generated. You should know what you did if you want to edit this
2+
-- !q01 --
3+
a b c d e f g h i j
4+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
CREATE TABLE STG_CUX_FND_COA_SEG3_V(
2+
flex_value_set_name varchar(500),
3+
flex_value varchar(500),
4+
flex_desc varchar(1000),
5+
flex_value_lev1 varchar(500),
6+
flex_desc_lev1 varchar(500),
7+
flex_value_lev2 varchar(500),
8+
flex_desc_lev2 varchar(500),
9+
flex_value_lev3 varchar(500),
10+
flex_desc_lev3 varchar(500),
11+
last_update_date varchar(50)
12+
)
13+
ENGINE=OLAP
14+
DISTRIBUTED BY HASH(`flex_value_set_name`) BUCKETS 1
15+
PROPERTIES (
16+
"replication_allocation" = "tag.location.default: 1"
17+
);
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
suite("load") {
2+
def tables =
3+
[
4+
"STG_CUX_FND_COA_SEG3_V"
5+
]
6+
for (String table in tables) {
7+
sql """DROP TABLE IF EXISTS ${table}"""
8+
sql new File("""${context.file.parent}/ddl/${table}.sql""").text
9+
}
10+
11+
sql """
12+
insert into STG_CUX_FND_COA_SEG3_V values ('a', 'b', 'c','d','e','f','g','h', 'i', 'j');
13+
"""
14+
15+
// 创建视图
16+
sql """
17+
create view STG_CUX_FND_COA_SEG3_V_MV_T as
18+
SELECT `scv`.`flex_value` AS `SEGMENT3`,
19+
`scv`.`flex_desc` AS `SEGMENT3_DESC`,
20+
`scv`.`flex_value_lev1` AS `SEGMENT3_LEV1`,
21+
`scv`.`flex_desc_lev1` AS `SEGMENT3_LEV1_DESC`,
22+
`scv`.`flex_value_lev2` AS `SEGMENT3_LEV2`,
23+
`scv`.`flex_desc_lev2` AS `SEGMENT3_LEV2_DESC`,
24+
`scv`.`flex_value_lev3` AS `SEGMENT3_LEV3`,
25+
`scv`.`flex_desc_lev3` AS `SEGMENT3_LEV3_DESC`
26+
FROM (SELECT `sccv`.`flex_value_set_name`,
27+
`sccv`.`flex_value`,
28+
`sccv`.`flex_desc`,
29+
`sccv`.`flex_value_lev1`,
30+
`sccv`.`flex_desc_lev1`,
31+
`sccv`.`flex_value_lev2`,
32+
`sccv`.`flex_desc_lev2`,
33+
`sccv`.`flex_value_lev3`,
34+
`sccv`.`flex_desc_lev3`,
35+
`sccv`.`last_update_date`,
36+
ROW_NUMBER() OVER (PARTITION BY `sccv`.`flex_value` ORDER BY `sccv`.`last_update_date` DESC) AS `GROUP_IDX`
37+
FROM `STG_CUX_FND_COA_SEG3_V` `sccv`) `scv`
38+
WHERE `scv`.`group_idx` = 1;
39+
"""
40+
41+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
select * from STG_CUX_FND_COA_SEG3_V;

0 commit comments

Comments
 (0)