You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: hoptimator-k8s/src/test/resources/k8s-ddl-function.id
+65-22
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
!set outputformat mysql
2
2
!use k8s
3
3
4
-
create or replace view ADS."case" AS SELECT CASE WHEN "FIRST_NAME" = 'Bob' THEN ARRAY['a'] ELSE ARRAY['b'] END || CASE WHEN "FIRST_NAME" = 'Alice' THEN ARRAY['c'] ELSE ARRAY['d'] END AS arr from profile.members;
4
+
create or replace materialized view ADS."case" AS SELECT CASE WHEN "FIRST_NAME" = 'Bob' THEN ARRAY['a'] ELSE ARRAY['b'] END || CASE WHEN "FIRST_NAME" = 'Alice' THEN ARRAY['c'] ELSE ARRAY['d'] END AS arr from profile.members;
5
5
(0 rows modified)
6
6
7
7
!update
@@ -18,24 +18,41 @@ select * from ADS."case";
18
18
19
19
!ok
20
20
21
-
create or replace view ADS."json" AS SELECT JSON_VALUE('{"a": 1}', '$.a') AS json from profile.members;
21
+
create or replace materialized view ADS."createJson" AS SELECT JSON_OBJECT('name':"FIRST_NAME", 'type':4) AS json from profile.members;
22
22
(0 rows modified)
23
23
24
24
!update
25
25
26
-
select * from ADS."json";
27
-
+------+
28
-
| JSON |
29
-
+------+
30
-
| 1 |
31
-
| 1 |
32
-
| 1 |
33
-
+------+
26
+
select * from ADS."createJson";
27
+
+-----------------------------+
28
+
| JSON |
29
+
+-----------------------------+
30
+
| {"name":"Alice","type":4} |
31
+
| {"name":"Bob","type":4} |
32
+
| {"name":"Charlie","type":4} |
33
+
+-----------------------------+
34
34
(3 rows)
35
35
36
36
!ok
37
37
38
-
create or replace view ADS."regex" AS SELECT REGEXP_REPLACE("FIRST_NAME", '(B)ob', '$1ill') AS name from profile.members;
38
+
create or replace materialized view ADS."extractJson" AS SELECT JSON_VALUE("JSON", '$.name') AS name from ads."createJson";
39
+
(0 rows modified)
40
+
41
+
!update
42
+
43
+
select * from ADS."extractJson";
44
+
+---------+
45
+
| NAME |
46
+
+---------+
47
+
| Alice |
48
+
| Bob |
49
+
| Charlie |
50
+
+---------+
51
+
(3 rows)
52
+
53
+
!ok
54
+
55
+
create or replace materialized view ADS."regex" AS SELECT REGEXP_REPLACE("FIRST_NAME", '(B)ob', '$1ill') AS name from profile.members;
39
56
(0 rows modified)
40
57
41
58
!update
@@ -52,7 +69,7 @@ select * from ads."regex";
52
69
53
70
!ok
54
71
55
-
create or replace view ADS."concat" AS SELECT CONCAT('_', "FIRST_NAME", '_') AS name from profile.members;
72
+
create or replace materialized view ADS."concat" AS SELECT CONCAT('_', "FIRST_NAME", '_') AS name from profile.members;
56
73
(0 rows modified)
57
74
58
75
!update
@@ -69,8 +86,7 @@ select * from ads."concat";
69
86
70
87
!ok
71
88
72
-
73
-
create or replace view ADS."listagg" AS SELECT LISTAGG("FIRST_NAME") AS agg FROM profile.members;
89
+
create or replace materialized view ADS."listagg" AS SELECT LISTAGG("FIRST_NAME") AS agg FROM profile.members;
74
90
(0 rows modified)
75
91
76
92
!update
@@ -85,7 +101,24 @@ select * from ads."listagg";
85
101
86
102
!ok
87
103
88
-
create or replace view ADS."unnested" AS SELECT * FROM UNNEST(ARRAY(SELECT "FIRST_NAME" FROM profile.members)) AS name;
104
+
create or replace materialized view ADS."arr" AS SELECT ARRAY["FIRST_NAME"] AS arr FROM profile.members;
105
+
(0 rows modified)
106
+
107
+
!update
108
+
109
+
select * from ADS."arr";
110
+
+-----------+
111
+
| ARR |
112
+
+-----------+
113
+
| [Alice] |
114
+
| [Bob] |
115
+
| [Charlie] |
116
+
+-----------+
117
+
(3 rows)
118
+
119
+
!ok
120
+
121
+
create or replace materialized view ADS."unnested" AS SELECT * FROM UNNEST(SELECT ARR FROM ADS."arr") AS name;
89
122
(0 rows modified)
90
123
91
124
!update
@@ -102,32 +135,42 @@ select * from ADS."unnested";
0 commit comments