Skip to content

Commit

Permalink
fix bug some bugs.
Browse files Browse the repository at this point in the history
update docs for chinese.
support more highlight keyword.
release v1.13.

Please enter the commit message for your changes. Lines starting
  • Loading branch information
camilesing committed Dec 15, 2024
1 parent 608d3db commit 67314e6
Show file tree
Hide file tree
Showing 20 changed files with 16,252 additions and 17,779 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ node_modules
.vscode
out
./gen
/gen
/gen
./FlinkSQL-Example
FlinkSQL-Example
script.sh
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### v1.13.3

- Update docs for chinese.
- Fix some bugs.
- Support more highlight keyword.

### v1.13.0

- Support Flink SQL v1.20: Materialized Tables, DISTRIBUTED BY Clause.
Expand Down
378 changes: 357 additions & 21 deletions LICENSE

Large diffs are not rendered by default.

66 changes: 45 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,55 @@
# Flink-SQL-Helper
一款帮助你更高效、专注开发FlinkSQL的插件。支持FlinkSQL(v1.20.0)的语法校验提示、代码高亮、关键字补全、重命名、查找全部引用、代码格式化等。

Help you efficiently and focus on FlinkSQL development. support Flink SQL error grammar check, syntax highlighting, complete keywords, rename, find all references and code format, including user-defined functions.
> 用户QQ群:913711491
> I suggest that you develop and debug on vscode based on the information (https://code.visualstudio.com/docs/java/java-debugging) to obtain a better experience.
> 如果你喜欢在IDEA中进行FlinkSQL的开发。我建议你使用[IDEA版的Flink SQL Helper](https://plugins.jetbrains.com/plugin/25912-flink-sql-helper),它支持了所有语句,在VsCode插件的基础上,它的报错信息也更加清晰。
> 如果你喜欢在VsCode上开发,那么配合[VS Code官网里的Java环境配置](https://code.visualstudio.com/docs/java/java-debugging)也会很棒。
## 1.Features
版本之间的差异见下面的介绍`VSCode plugin VS IDEA plugin`

### 1.1 Grammar Check
---

Grammar check when you save edit (suggest you turn off automatic saving).
Help you efficiently and focus on FlinkSQL development. support FlinkSQL(v1.20.0) error grammar check, syntax highlighting, complete keywords, rename, find all references and code format.

> If you like develop Flink SQL in IDEA, you can use IDEA version of the plugin——[Flink SQL Helper](https://plugins.jetbrains.com/plugin/25912-flink-sql-helper), Its grammar error message is more powerful and supports all statement.
Or you like develop Flink SQL in VsCode. i suggest that you develop and debug on vscode based on [the information](https://code.visualstudio.com/docs/java/java-debugging) to obtain a better experience.

VSCode plugin VS IDEA plugin:
![](docs/images/feature_diff.jpg)


## 1.功能介绍(Features)

### 1.1 语法检测(Grammar Check)

语法检测将会在你保存时进行检测(强烈建议你关闭自动保存)。这个功能需要在配置中手动开启(默认不开启):

Grammar check when you save edit (suggest you turn off automatic saving).the feature needs enabled in the configuration(not enabled by default):

1. ![](docs/images/setting_1.png)
2. ![](docs/images/setting_2.png)

运行例子:

example:

- ![](docs/images/unexpect_input_v2.jpg)
- ![](docs/images/select_not_expect_comma_v3.jpg)
- ![](docs/images/expect_semicolon_v3.jpg)

if you dont like the feature, you can setting config to turn off and show you how to change config:
1. ![](docs/images/setting_1.png)
2. ![](docs/images/setting_2.png)


### 1.2 Refactorings
### 1.2 重构(Refactorings)

![](docs/images/refactorings.gif)

### 1.3 Code Completion Proposals
### 1.3 代码补全(Code Completion Proposals)

![](docs/images/code_completion_proposal_v3.gif)

### 1.4 Snippets
### 1.4 快捷代码(Snippets)

snippets keywords:
可触发关键字(snippets keywords):

- create
- select
Expand Down Expand Up @@ -59,28 +77,31 @@ snippets keywords:

![](docs/images/windows_snippets.gif)

### 1.5 Find All References
### 1.5 查找所有的引用(Find All References)

![](docs/images/find-all-references.gif)

### 1.5 Show References
### 1.5 查找引用(Show References)

![](docs/images/show_references.gif)

### 1.7 Code Format
### 1.7 代码格式化(Code Format)

![](docs/images/format.gif)

## 2. User Guide
## 2. 用户手册(User Guide)
如果你想让插件在你的FlinkSQL文件中生效,你的扩展名需要是`.fql`

Enable the extension on your file, either name the file with a extension:
或者通过按F1,输入`Change Language Mode`,然后选择FlinkSQL。

- SQL
- FQL

Enable the extension on your Flink SQL file, either name the file with a extension `.fql` .

Or press F1, type 'Change Language Mode', and then choose FlinkSQL.

### 2.1 Color theme recommend
### 2.1 配色建议(Color theme recommend)

按F1, 选择`Preference: Color Theme`,然后复制下面的配色进去。

Press F1, choose `Preference: Open User Setting(JSON)` then paste:

Expand Down Expand Up @@ -219,4 +240,7 @@ Press F1, choose `Preference: Open User Setting(JSON)` then paste:
}
~~~

我们提供了很多个选项,可以让开发者更好的定制自己的主题。如果你对主题有更多需求,可以查看 `syntaxes/flink.tmLanguage.json` 来了解关键字和配色映射。


We provide so many options to allow developers to better customize their favorite themes. if you want to deep in, please see the `syntaxes/flink.tmLanguage.json` to understand keyword and color theme mapping.
3 changes: 3 additions & 0 deletions docs/Develop Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
- Edit `FlinkSQL.g4`
- Run `npm run antlr4ts` generate for ts code then move to src directory.
- Copy ./gen ts file to src directory

# 4. If you want to add keywod and highlight
- Add to `flink.tmLanguage.json`.
Binary file added docs/images/feature_diff.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/performance/error/create_tmp_view.fql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM
SELECT
*,
ROW_NUMBER() OVER (
PARTITION FLOOR( --miss 'BY'
PARTITION FLOOR( --miss 'BY'
TO_TIMESTAMP(
FROM_UNIXTIME(event_time / 1000, 'yyyy-MM-dd HH:mm:ss')
) TO HOUR
Expand Down
3 changes: 0 additions & 3 deletions docs/performance/psss/create_database.fql

This file was deleted.

28 changes: 0 additions & 28 deletions docs/performance/psss/create_temp_view.fql

This file was deleted.

27 changes: 0 additions & 27 deletions docs/performance/psss/create_tmp_view.fql

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,42 @@ where
create_timestamp is not null
group by
id,
name;
name;

insert into
table1
select
ARRAY [ ROW(
f1,
f2,
f3,
f4,
f5
)] as message
from
source_table;

CREATE TABLE source_table (
application_id STRING,
main_id STRING,
province STRING,
s_id STRING,
areacode STRING,
proctime AS PROCTIME()
) WITH (
'connector' = 'filesystem',
'path' = '/path/to/example.csv',
'format' = 'csv'
);

-----------------------Time Travel
-- use timestamp constant expression
SELECT
select_list
FROM
paimon_tb FOR SYSTEM_TIME AS OF TIMESTAMP '2023-07-31 00:00:00';
--use expression with functions that can be reduced to a timestamp constant
SELECT
select_list
FROM
paimon_tb FOR SYSTEM_TIME AS OF TIMESTAMP '2023-07-31 00:00:00' - INTERVAL '1' DAY;
12 changes: 0 additions & 12 deletions docs/performance/psss/select_array.fql

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "flink-sql",
"version": "1.13.0",
"version": "1.13.3",
"displayName": "Flink SQL Helper",
"description": "Help you efficiently and focus on Flink SQL development. support Flink SQL error grammar check, syntax highlighting, complete keywords, rename, find all references and code format, including user-defined functions.",
"description": "Help you efficiently and focus on FlinkSQL development. support Flink SQL error grammar check, syntax highlighting, complete keywords, rename, find all references and code format.",
"publisher": "CamileSing",
"author": {
"name": "CamileSing",
Expand Down
Loading

0 comments on commit 67314e6

Please sign in to comment.