@clickzetta/cz-cli-darwin-x64 0.3.89 → 0.3.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cz-cli +0 -0
- package/bin/skills/clickzetta-dynamic-table/SKILL.md +169 -169
- package/bin/skills/clickzetta-dynamic-table/best-practices/dimension-table-join-guide.md +126 -126
- package/bin/skills/clickzetta-dynamic-table/best-practices/medallion-and-stream-patterns.md +25 -25
- package/bin/skills/clickzetta-dynamic-table/best-practices/non-partitioned-merge-into-warning.md +48 -48
- package/bin/skills/clickzetta-dynamic-table/best-practices/performance-optimization.md +51 -51
- package/bin/skills/clickzetta-dynamic-table/best-practices/scheduling-guide.md +59 -59
- package/bin/skills/clickzetta-dynamic-table/dt-creator/SKILL.md +8 -7
- package/bin/skills/clickzetta-dynamic-table/dt-creator/references/dt-declaration-strategy.md +99 -99
- package/bin/skills/clickzetta-dynamic-table/dt-creator/references/incremental-config-reference.md +188 -188
- package/bin/skills/clickzetta-dynamic-table/dt-creator/references/refresh-history-guide.md +117 -117
- package/bin/skills/clickzetta-dynamic-table/dt-creator/references/sql-limitations.md +29 -29
- package/bin/skills/clickzetta-dynamic-table/dynamic-table-alter/SKILL.md +80 -79
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/SKILL.md +15 -15
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-column-validation-rules.md +61 -61
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-conversion-rules.md +100 -100
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-placeholder-rules.md +64 -64
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-refresh-rules.md +32 -32
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-self-reference-rules.md +21 -21
- package/bin/skills/clickzetta-dynamic-table/sql-to-dt/references/sql2dt-workflow.md +71 -71
- package/bin/skills/clickzetta-sql-pipeline-manager/SKILL.md +203 -202
- package/bin/skills/clickzetta-sql-pipeline-manager/references/dynamic-table.md +62 -62
- package/bin/skills/clickzetta-sql-pipeline-manager/references/materialized-view.md +34 -34
- package/bin/skills/clickzetta-sql-pipeline-manager/references/pipe.md +61 -61
- package/bin/skills/clickzetta-sql-pipeline-manager/references/table-stream.md +41 -41
- package/bin/skills/clickzetta-table-stream-pipeline/SKILL.md +103 -101
- package/package.json +1 -1
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
# Dynamic Table
|
|
1
|
+
# Dynamic Table Incremental Refresh History Query Guide
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
There are three ways to view the incremental refresh history of a DT/MV, each suited to different scenarios.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Method 1: SHOW DYNAMIC TABLE REFRESH HISTORY
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
View job-level information for DT refreshes, including the status, duration, trigger type, and refresh mode of each refresh.
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Syntax
|
|
12
12
|
|
|
13
13
|
```sql
|
|
14
|
-
--
|
|
14
|
+
-- Filter by WHERE (name column matches table name)
|
|
15
15
|
SHOW DYNAMIC TABLE REFRESH HISTORY WHERE name = 'my_dt';
|
|
16
16
|
|
|
17
|
-
--
|
|
17
|
+
-- Combine WHERE + LIMIT
|
|
18
18
|
SHOW DYNAMIC TABLE REFRESH HISTORY WHERE name = 'my_dt' AND state = 'SUCCEED' LIMIT 20;
|
|
19
19
|
|
|
20
|
-
-- MV
|
|
20
|
+
-- MV supports the same syntax
|
|
21
21
|
SHOW MATERIALIZED VIEW REFRESH HISTORY WHERE name = 'my_mv' LIMIT 10;
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
###
|
|
24
|
+
### Output Columns
|
|
25
25
|
|
|
26
|
-
|
|
|
26
|
+
| Column | Type | Description |
|
|
27
27
|
|------|------|------|
|
|
28
|
-
| workspace_name | STRING |
|
|
29
|
-
| schema_name | STRING |
|
|
30
|
-
| name | STRING | DT/MV
|
|
31
|
-
| virtual_cluster | STRING |
|
|
32
|
-
| start_time | TIMESTAMP |
|
|
33
|
-
| end_time | TIMESTAMP |
|
|
34
|
-
| duration | INTERVAL |
|
|
35
|
-
| state | STRING |
|
|
36
|
-
| refresh_trigger | STRING |
|
|
37
|
-
| refresh_mode | STRING |
|
|
38
|
-
| error_message | STRING |
|
|
39
|
-
| source_tables | ARRAY<MAP<STRING,STRING>> |
|
|
40
|
-
| stats | MAP<STRING,STRING> |
|
|
41
|
-
| job_id | STRING |
|
|
42
|
-
|
|
43
|
-
### refresh_mode
|
|
44
|
-
|
|
45
|
-
`refresh_mode`
|
|
46
|
-
|
|
47
|
-
|
|
|
28
|
+
| workspace_name | STRING | Workspace the DT/MV belongs to |
|
|
29
|
+
| schema_name | STRING | Schema the DT/MV belongs to |
|
|
30
|
+
| name | STRING | DT/MV name |
|
|
31
|
+
| virtual_cluster | STRING | Virtual cluster that executed the refresh |
|
|
32
|
+
| start_time | TIMESTAMP | Refresh start time |
|
|
33
|
+
| end_time | TIMESTAMP | Refresh end time (NULL while running) |
|
|
34
|
+
| duration | INTERVAL | Refresh duration (shows elapsed time while running) |
|
|
35
|
+
| state | STRING | Refresh status (SUCCEED / FAILED / RUNNING, etc.) |
|
|
36
|
+
| refresh_trigger | STRING | Trigger type: `SYSTEM_SCHEDULED` (auto-triggered by system) or `MANUAL` (user manually triggered REFRESH) |
|
|
37
|
+
| refresh_mode | STRING | Refresh mode; see detailed description below |
|
|
38
|
+
| error_message | STRING | Error message on failure (NULL on success) |
|
|
39
|
+
| source_tables | ARRAY<MAP<STRING,STRING>> | Source table list; each element is a MAP with keys `workspace`, `schema`, `table_name` |
|
|
40
|
+
| stats | MAP<STRING,STRING> | Refresh statistics, including `rows_inserted` and `rows_deleted` |
|
|
41
|
+
| job_id | STRING | Corresponding Job ID; can be used to join `information_schema.job_history` for more details |
|
|
42
|
+
|
|
43
|
+
### refresh_mode Details
|
|
44
|
+
|
|
45
|
+
`refresh_mode` is the key field for determining whether incremental computation is working:
|
|
46
|
+
|
|
47
|
+
| Value | Meaning | Description |
|
|
48
48
|
|----|------|------|
|
|
49
|
-
| `INCREMENTAL` |
|
|
50
|
-
| `FULL` |
|
|
51
|
-
| `NO_DATA` |
|
|
49
|
+
| `INCREMENTAL` | Incremental refresh | The incremental engine successfully generated an incremental plan and only processed change data from source tables |
|
|
50
|
+
| `FULL` | Full refresh | Fell back to full recomputation. Possible reasons: first refresh, dimension table change, incremental plan generation failed, user forced full, etc. |
|
|
51
|
+
| `NO_DATA` | No data changes | No new data changes in source tables since the last refresh; this refresh skipped computation |
|
|
52
52
|
|
|
53
|
-
### source_tables
|
|
53
|
+
### source_tables Details
|
|
54
54
|
|
|
55
|
-
`source_tables`
|
|
55
|
+
The `source_tables` column returns information about all input tables involved in this refresh; each element is a MAP:
|
|
56
56
|
|
|
57
57
|
```
|
|
58
58
|
[
|
|
@@ -61,77 +61,77 @@ SHOW MATERIALIZED VIEW REFRESH HISTORY WHERE name = 'my_mv' LIMIT 10;
|
|
|
61
61
|
]
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
### stats
|
|
64
|
+
### stats Details
|
|
65
65
|
|
|
66
|
-
`stats`
|
|
66
|
+
The `stats` column returns write statistics for the target table from this refresh:
|
|
67
67
|
|
|
68
68
|
```
|
|
69
69
|
{"rows_inserted": "1000", "rows_deleted": "50"}
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
-
- `rows_inserted
|
|
73
|
-
- `rows_deleted
|
|
72
|
+
- `rows_inserted`: number of rows inserted into the target table in this refresh
|
|
73
|
+
- `rows_deleted`: number of rows deleted from the target table in this refresh (in incremental mode, update operations produce delete + insert)
|
|
74
74
|
|
|
75
|
-
###
|
|
75
|
+
### Typical Usage
|
|
76
76
|
|
|
77
77
|
```sql
|
|
78
|
-
--
|
|
78
|
+
-- View failed refresh records
|
|
79
79
|
SHOW DYNAMIC TABLE REFRESH HISTORY WHERE name = 'my_dt' AND state = 'FAILED';
|
|
80
80
|
|
|
81
|
-
--
|
|
81
|
+
-- Check if it fell back to full refresh (troubleshoot whether incremental is working)
|
|
82
82
|
SHOW DYNAMIC TABLE REFRESH HISTORY WHERE name = 'my_dt' AND refresh_mode = 'FULL';
|
|
83
83
|
|
|
84
|
-
--
|
|
84
|
+
-- View no-data-change refreshes (appears when source table has no new data)
|
|
85
85
|
SHOW DYNAMIC TABLE REFRESH HISTORY WHERE name = 'my_dt' AND refresh_mode = 'NO_DATA';
|
|
86
86
|
|
|
87
|
-
--
|
|
87
|
+
-- View system auto-scheduled refreshes
|
|
88
88
|
SHOW DYNAMIC TABLE REFRESH HISTORY WHERE name = 'my_dt' AND refresh_trigger = 'SYSTEM_SCHEDULED';
|
|
89
89
|
```
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
-
##
|
|
93
|
+
## Method 2: DESC HISTORY
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
View version-level history of a table, including row count, bytes, and operation type for each version. Useful for understanding data change granularity.
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### Syntax
|
|
98
98
|
|
|
99
99
|
```sql
|
|
100
|
-
--
|
|
100
|
+
-- View version history of a DT
|
|
101
101
|
DESC HISTORY my_dt;
|
|
102
102
|
|
|
103
|
-
--
|
|
103
|
+
-- View version history of a source table
|
|
104
104
|
DESC HISTORY source_table;
|
|
105
105
|
|
|
106
|
-
--
|
|
106
|
+
-- Supports WHERE filtering
|
|
107
107
|
DESC HISTORY my_dt WHERE version > 10;
|
|
108
108
|
|
|
109
|
-
--
|
|
109
|
+
-- Supports LIMIT
|
|
110
110
|
DESC HISTORY my_dt LIMIT 20;
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
###
|
|
113
|
+
### Output Columns
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
For regular tables (DESC_TABLE_HISTORY):
|
|
116
116
|
|
|
117
|
-
|
|
|
117
|
+
| Column | Type | Description |
|
|
118
118
|
|------|------|------|
|
|
119
|
-
| sequence | BIGINT |
|
|
120
|
-
| version | BIGINT |
|
|
121
|
-
| time | TIMESTAMP |
|
|
122
|
-
| total_rows | BIGINT |
|
|
123
|
-
| total_bytes | BIGINT |
|
|
124
|
-
| user | STRING |
|
|
125
|
-
| operation | STRING |
|
|
126
|
-
| job_id | STRING |
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
|
119
|
+
| sequence | BIGINT | Sequence number |
|
|
120
|
+
| version | BIGINT | Version number |
|
|
121
|
+
| time | TIMESTAMP | Version creation time |
|
|
122
|
+
| total_rows | BIGINT | Total row count for this version |
|
|
123
|
+
| total_bytes | BIGINT | Total bytes for this version |
|
|
124
|
+
| user | STRING | User who performed the operation |
|
|
125
|
+
| operation | STRING | Operation type (INSERT / COMPACTION / REFRESH, etc.) |
|
|
126
|
+
| job_id | STRING | Corresponding Job ID |
|
|
127
|
+
|
|
128
|
+
For DT/MV (DESC_MV_HISTORY), additionally includes:
|
|
129
|
+
|
|
130
|
+
| Column | Type | Description |
|
|
131
131
|
|------|------|------|
|
|
132
|
-
| source_tables | ARRAY<MAP<STRING,STRING>> |
|
|
132
|
+
| source_tables | ARRAY<MAP<STRING,STRING>> | Source tables and their corresponding version information |
|
|
133
133
|
|
|
134
|
-
DESC HISTORY
|
|
134
|
+
DESC HISTORY's `source_tables` for DT/MV is more detailed than SHOW REFRESH HISTORY, including snapshot information for each source table at that version:
|
|
135
135
|
|
|
136
136
|
```
|
|
137
137
|
[
|
|
@@ -140,75 +140,75 @@ DESC HISTORY 对 DT/MV 的 `source_tables` 比 SHOW REFRESH HISTORY 更详细,
|
|
|
140
140
|
]
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
- `version
|
|
144
|
-
- `sequence
|
|
145
|
-
- `commit_time
|
|
143
|
+
- `version`: snapshot_id of the source table
|
|
144
|
+
- `sequence`: sequence number of the source table
|
|
145
|
+
- `commit_time`: commit time of that version of the source table
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
This information can be used to trace which version of source table data was read in a given refresh.
|
|
148
148
|
|
|
149
|
-
###
|
|
149
|
+
### Typical Usage
|
|
150
150
|
|
|
151
151
|
```sql
|
|
152
|
-
--
|
|
152
|
+
-- View recent version changes of a DT; confirm compaction is executing normally
|
|
153
153
|
DESC HISTORY my_dt LIMIT 10;
|
|
154
154
|
|
|
155
|
-
--
|
|
155
|
+
-- View version history of a source table; determine data write frequency
|
|
156
156
|
DESC HISTORY source_table LIMIT 20;
|
|
157
157
|
|
|
158
|
-
--
|
|
158
|
+
-- View compaction records of a DT
|
|
159
159
|
DESC HISTORY my_dt WHERE operation = 'COMPACTION';
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
---
|
|
163
163
|
|
|
164
|
-
##
|
|
164
|
+
## Method 3: information_schema.materialized_view_refresh_history
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
Query refresh history from information_schema; suitable for cross-table batch analysis, integration with other systems, or long-term trend monitoring. Data is partitioned by day (pt_date); retention days are determined by system configuration.
|
|
167
167
|
|
|
168
|
-
###
|
|
168
|
+
### Syntax
|
|
169
169
|
|
|
170
170
|
```sql
|
|
171
|
-
--
|
|
171
|
+
-- View refresh history for a specific DT
|
|
172
172
|
SELECT *
|
|
173
173
|
FROM information_schema.materialized_view_refresh_history
|
|
174
174
|
WHERE materialized_view_name = 'my_dt'
|
|
175
175
|
ORDER BY start_time DESC
|
|
176
176
|
LIMIT 10;
|
|
177
177
|
|
|
178
|
-
--
|
|
178
|
+
-- View refresh status of all DTs on a given day
|
|
179
179
|
SELECT materialized_view_name, status, start_time, end_time, error_message
|
|
180
180
|
FROM information_schema.materialized_view_refresh_history
|
|
181
181
|
WHERE pt_date = '2025-01-15'
|
|
182
182
|
ORDER BY start_time DESC;
|
|
183
183
|
|
|
184
|
-
--
|
|
184
|
+
-- View failed refreshes
|
|
185
185
|
SELECT materialized_view_name, error_code, error_message, start_time
|
|
186
186
|
FROM information_schema.materialized_view_refresh_history
|
|
187
187
|
WHERE status = 'FAILED' AND pt_date >= '2025-01-01'
|
|
188
188
|
ORDER BY start_time DESC;
|
|
189
189
|
```
|
|
190
190
|
|
|
191
|
-
###
|
|
191
|
+
### Output Columns
|
|
192
192
|
|
|
193
|
-
|
|
|
193
|
+
| Column | Type | Description |
|
|
194
194
|
|------|------|------|
|
|
195
|
-
| workspace_name | STRING |
|
|
196
|
-
| schema_name | STRING |
|
|
197
|
-
| materialized_view_name | STRING | DT/MV
|
|
198
|
-
| cru | DOUBLE |
|
|
199
|
-
| virtual_cluster_name | STRING |
|
|
200
|
-
| status | STRING |
|
|
201
|
-
| scheduled_start_time | TIMESTAMP |
|
|
202
|
-
| start_time | TIMESTAMP |
|
|
203
|
-
| end_time | TIMESTAMP |
|
|
204
|
-
| error_code | STRING |
|
|
205
|
-
| error_message | STRING |
|
|
206
|
-
| pt_date | STRING |
|
|
207
|
-
|
|
208
|
-
###
|
|
195
|
+
| workspace_name | STRING | Workspace the DT/MV belongs to |
|
|
196
|
+
| schema_name | STRING | Schema the DT/MV belongs to |
|
|
197
|
+
| materialized_view_name | STRING | DT/MV name |
|
|
198
|
+
| cru | DOUBLE | Compute resource units consumed |
|
|
199
|
+
| virtual_cluster_name | STRING | Virtual cluster that executed the refresh |
|
|
200
|
+
| status | STRING | Refresh status |
|
|
201
|
+
| scheduled_start_time | TIMESTAMP | Scheduled start time |
|
|
202
|
+
| start_time | TIMESTAMP | Actual start time |
|
|
203
|
+
| end_time | TIMESTAMP | End time |
|
|
204
|
+
| error_code | STRING | Error code |
|
|
205
|
+
| error_message | STRING | Error message |
|
|
206
|
+
| pt_date | STRING | Partition date |
|
|
207
|
+
|
|
208
|
+
### Typical Usage
|
|
209
209
|
|
|
210
210
|
```sql
|
|
211
|
-
--
|
|
211
|
+
-- Calculate the refresh success rate of a DT over the last 7 days
|
|
212
212
|
SELECT
|
|
213
213
|
pt_date,
|
|
214
214
|
COUNT(*) AS total,
|
|
@@ -220,7 +220,7 @@ WHERE materialized_view_name = 'my_dt'
|
|
|
220
220
|
GROUP BY pt_date
|
|
221
221
|
ORDER BY pt_date;
|
|
222
222
|
|
|
223
|
-
--
|
|
223
|
+
-- View refreshes that consumed the most CRU
|
|
224
224
|
SELECT materialized_view_name, cru, start_time, end_time
|
|
225
225
|
FROM information_schema.materialized_view_refresh_history
|
|
226
226
|
WHERE pt_date >= '2025-01-01'
|
|
@@ -228,33 +228,33 @@ ORDER BY cru DESC
|
|
|
228
228
|
LIMIT 10;
|
|
229
229
|
```
|
|
230
230
|
|
|
231
|
-
###
|
|
231
|
+
### Difference from information_schema.job_history
|
|
232
232
|
|
|
233
|
-
`information_schema.job_history`
|
|
233
|
+
`information_schema.job_history` records all types of Jobs (SQL queries, DML, DDL, etc.), while `materialized_view_refresh_history` specifically records DT/MV refresh history with more targeted fields.
|
|
234
234
|
|
|
235
|
-
|
|
235
|
+
If you need to view complete information about a refresh Job (e.g., job_text, input_bytes, etc.), you can join via job_id:
|
|
236
236
|
|
|
237
237
|
```sql
|
|
238
|
-
--
|
|
238
|
+
-- Get job_id from SHOW DYNAMIC TABLE REFRESH HISTORY, then look up details in job_history
|
|
239
239
|
SELECT *
|
|
240
240
|
FROM information_schema.job_history
|
|
241
|
-
WHERE job_id = '
|
|
241
|
+
WHERE job_id = '<job_id from SHOW REFRESH HISTORY>'
|
|
242
242
|
AND pt_date = '2025-01-15';
|
|
243
243
|
```
|
|
244
244
|
|
|
245
245
|
---
|
|
246
246
|
|
|
247
|
-
##
|
|
247
|
+
## Comparison of Three Methods
|
|
248
248
|
|
|
249
|
-
|
|
|
249
|
+
| Feature | SHOW REFRESH HISTORY | DESC HISTORY | information_schema |
|
|
250
250
|
|------|---------------------|--------------|-------------------|
|
|
251
|
-
|
|
|
252
|
-
|
|
|
253
|
-
|
|
|
254
|
-
|
|
|
255
|
-
|
|
|
256
|
-
|
|
|
257
|
-
| CRU
|
|
258
|
-
|
|
|
259
|
-
|
|
|
260
|
-
|
|
|
251
|
+
| Granularity | Refresh job level | Table version level | Refresh job level |
|
|
252
|
+
| Refresh mode (incremental/full/no data) | ✅ refresh_mode | ❌ | ❌ |
|
|
253
|
+
| Trigger type (scheduled/manual) | ✅ refresh_trigger | ❌ | ❌ |
|
|
254
|
+
| Write statistics (inserted/deleted) | ✅ stats | ❌ | ❌ |
|
|
255
|
+
| Source table list | ✅ table name level | ✅ includes version/sequence/commit_time | ❌ |
|
|
256
|
+
| Version number / total rows / total bytes | ❌ | ✅ version/total_rows/total_bytes | ❌ |
|
|
257
|
+
| CRU consumption | ❌ | ❌ | ✅ cru |
|
|
258
|
+
| Cross-table batch queries | ❌ (single table) | ❌ (single table) | ✅ (batch supported) |
|
|
259
|
+
| Compaction records | ❌ | ✅ | ❌ |
|
|
260
|
+
| Applicable scenarios | Troubleshoot whether incremental is working; refresh status | View data version changes; trace source table versions | Batch analysis / monitoring / CRU statistics |
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
# Dynamic Table SQL
|
|
1
|
+
# Dynamic Table SQL Limitations and Support Matrix
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This document lists the SQL patterns that Dynamic Table incremental computation supports and does not support.
|
|
4
4
|
|
|
5
|
-
## JOIN
|
|
5
|
+
## JOIN Type Support
|
|
6
6
|
|
|
7
|
-
| JOIN
|
|
7
|
+
| JOIN type | Incremental support | Notes |
|
|
8
8
|
|-----------|---------|------|
|
|
9
|
-
| INNER JOIN | ✅ |
|
|
10
|
-
| LEFT JOIN (LEFT OUTER) | ✅ |
|
|
11
|
-
| RIGHT JOIN (RIGHT OUTER) | ✅ |
|
|
12
|
-
| FULL OUTER JOIN | ✅ |
|
|
13
|
-
| LEFT SEMI JOIN | ✅ |
|
|
14
|
-
| LEFT ANTI JOIN | ✅ |
|
|
9
|
+
| INNER JOIN | ✅ | Fully supported |
|
|
10
|
+
| LEFT JOIN (LEFT OUTER) | ✅ | Fully supported |
|
|
11
|
+
| RIGHT JOIN (RIGHT OUTER) | ✅ | Fully supported |
|
|
12
|
+
| FULL OUTER JOIN | ✅ | Fully supported |
|
|
13
|
+
| LEFT SEMI JOIN | ✅ | Fully supported |
|
|
14
|
+
| LEFT ANTI JOIN | ✅ | Fully supported |
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Aggregate Function Support
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### Aggregate functions that support incremental computation
|
|
19
19
|
|
|
20
20
|
- `SUM`, `SUM0`, `COUNT`, `COUNT_IF`, `MIN`, `MAX`, `MIN_BY`, `MAX_BY`
|
|
21
21
|
- `AVG`, `STDDEV_SAMP`, `STDDEV_POP`, `VAR_SAMP`, `VAR_POP`
|
|
22
22
|
- `Percentile`, `Median`, `COUNT_DISTINCT`
|
|
23
23
|
- `BIT_OR`, `BIT_AND`, `BIT_XOR`, `BOOL_OR`, `BOOL_AND`
|
|
24
|
-
- `GROUP_BITMAP`
|
|
24
|
+
- `GROUP_BITMAP` series
|
|
25
25
|
- `COLLECT_SET`, `COLLECT_LIST`, `COLLECT_SET_ON_ARRAY`, `COLLECT_LIST_ON_ARRAY`
|
|
26
26
|
- `MAP_AGG`, `WM_CONCAT`
|
|
27
27
|
|
|
28
|
-
###
|
|
28
|
+
### Aggregate functions with unstable results (incremental results may differ from full refresh)
|
|
29
29
|
|
|
30
30
|
- `ANY_VALUE`, `FIRST_VALUE`, `LAST_VALUE`
|
|
31
31
|
- `APPROX_COUNT_DISTINCT`, `APPROX_HISTOGRAM`, `APPROX_TOP_K`, `APPROX_PERCENTILE`
|
|
32
32
|
- `JSON_MERGE_AGG`
|
|
33
33
|
|
|
34
|
-
##
|
|
34
|
+
## Window Function Support
|
|
35
35
|
|
|
36
|
-
###
|
|
36
|
+
### Supported window functions
|
|
37
37
|
|
|
38
38
|
- `ROW_NUMBER`, `RANK`, `DENSE_RANK`, `PERCENT_RANK`
|
|
39
39
|
- `FIRST_VALUE`, `LAST_VALUE`, `NTH_VALUE`
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
|
|
44
44
|
## ORDER BY / LIMIT / OFFSET
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
`ORDER BY`, `LIMIT`, and `OFFSET` syntax are supported.
|
|
47
47
|
|
|
48
|
-
⚠️
|
|
48
|
+
⚠️ Global `ORDER BY` inside a DT is not recommended. Global sorting has very high overhead on every incremental refresh. It is recommended to apply sorting logic when querying data downstream, not during the ETL modeling stage.
|
|
49
49
|
|
|
50
|
-
##
|
|
50
|
+
## Non-deterministic Functions
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
-
|
|
52
|
+
Non-deterministic functions (such as `NOW()`, `CURRENT_TIMESTAMP`, `CURRENT_DATE`, `random()`, etc.) are supported by default when they do not participate in computation logic. Specifically, as long as these functions do not appear in the following positions, they can be used normally:
|
|
53
|
+
- `PARTITION BY` key of a window function
|
|
54
54
|
- `JOIN` key
|
|
55
55
|
- `GROUP BY` key
|
|
56
|
-
-
|
|
56
|
+
- Input arguments of other functions
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Typical use case: output the data processing time directly in SELECT, recording the moment each row was processed by the DT refresh:
|
|
59
59
|
|
|
60
60
|
```sql
|
|
61
61
|
CREATE DYNAMIC TABLE order_with_process_time AS
|
|
@@ -63,18 +63,18 @@ SELECT
|
|
|
63
63
|
id,
|
|
64
64
|
amount,
|
|
65
65
|
status,
|
|
66
|
-
CURRENT_TIMESTAMP AS process_time --
|
|
66
|
+
CURRENT_TIMESTAMP AS process_time -- records the processing time at refresh; output directly to target table
|
|
67
67
|
FROM orders
|
|
68
68
|
WHERE status = 'completed';
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Time functions are constant-folded to the current refresh timestamp on each REFRESH.
|
|
72
72
|
|
|
73
73
|
## UDF / UDAF / UDTF
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
Custom functions must be declared as deterministic at creation time to use incremental computation in a DT. Custom functions not declared as deterministic will cause incremental computation to be disabled.
|
|
76
76
|
|
|
77
|
-
##
|
|
77
|
+
## Source Table Type Limitations
|
|
78
78
|
|
|
79
|
-
-
|
|
80
|
-
-
|
|
79
|
+
- **Virtual views (VIEW)**: cannot be used as input tables for a DT; will disable incremental computation
|
|
80
|
+
- **External tables (External Table)**: incremental computation is not supported
|