Skip to content

Commit 72a4aee

Browse files
committed
Support snippets Join and Create UDF
1 parent f4a1bd5 commit 72a4aee

6 files changed

Lines changed: 27 additions & 14 deletions

File tree

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ example:
2525

2626
### 1.4 Snippets
2727
snippets keywords:
28-
- create
29-
- select
30-
- insert
31-
32-
![](images/flink-sql-vscode-snippets.gif)
28+
#### create
29+
![](images/create_snippets.gif)
30+
#### select
31+
![](images/select_snippets.gif)
32+
#### insert
33+
![](images/insert_snippets.gif)
3334

3435
### 1.5 Code Format
3536
Select your FlinkSQL code and press ```Alt+Shift+f```.

images/create_snippets.gif

458 KB
Loading
-89.5 KB
Binary file not shown.

images/insert_snippets.gif

119 KB
Loading

images/select_snippets.gif

41.7 KB
Loading

snippets/snippets.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,23 @@
2121
],
2222
"description": "Create a table with the same format and structure as another table."
2323
},
24+
"Create view statement": {
25+
"prefix": "create",
26+
"body": [
27+
"CREATE TEMPORARY VIEW ${1:view_name} AS",
28+
"SELECT",
29+
" ${2:first_column_name},",
30+
" ${3:last_column_name}",
31+
"FROM",
32+
" ${4:source_schema_name}.${5:source_table_name};"
33+
]
34+
},
35+
"Create UDF": {
36+
"prefix": "create",
37+
"body": [
38+
"CREATE TEMPORARY FUNCTION IF NOT EXISTS your_function_name AS 'com.example.ExampleUdf';"
39+
]
40+
},
2441
"Select columns from a table": {
2542
"prefix": "select",
2643
"body": [
@@ -31,23 +48,18 @@
3148
"Insert statement": {
3249
"prefix": "insert",
3350
"body": [
34-
"INSERT ${1|INTO,OVERWRITE|} TABLE ${2:schema_name}.${3:table_name}",
51+
"INSERT ${1|INTO,OVERWRITE|} ${2:schema_name}.${3:table_name}",
3552
"SELECT",
3653
" ${4:first_column_name},",
3754
" ${5:last_column_name}",
3855
"FROM",
3956
" ${6:source_schema_name}.${7:source_table_name};"
4057
]
4158
},
42-
"Create view statement": {
43-
"prefix": "create",
59+
"Join": {
60+
"prefix": "join",
4461
"body": [
45-
"CREATE TEMPORARY VIEW ${1:view_name} AS",
46-
"SELECT",
47-
" ${2:first_column_name},",
48-
" ${3:last_column_name}",
49-
"FROM",
50-
" ${4:source_schema_name}.${5:source_table_name};"
62+
"join table_2 FOR SYSTEM_TIME AS OF table_1.proctime as r on table_1.ip = r.ip"
5163
]
5264
}
5365
}

0 commit comments

Comments
 (0)