From 72c13b7bc782338f12a1ac60969c5c2d47f0567c Mon Sep 17 00:00:00 2001 From: wewoor Date: Wed, 14 Jun 2023 10:51:01 +0800 Subject: [PATCH] docs: update content --- CHANGELOG.md | 30 --------------------- README.md | 11 ++++---- test/parser/flinksql/benchmark/benchmark.md | 18 ++++++------- 3 files changed, 15 insertions(+), 44 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab6bc41..7682b90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,39 +2,10 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -## [4.0.0](https://github.com/DTStack/dt-sql-parser/compare/v4.0.0-beta.3.1...v4.0.0) (2023-06-14) - - -### Features - -* complete Query statements of FlinkSQL ([#93](https://github.com/DTStack/dt-sql-parser/issues/93)) ([a026ae0](https://github.com/DTStack/dt-sql-parser/commit/a026ae059297d732dd5af7af4a851c5fe55a3229)) -* extracting the common readSQL function ([4af913c](https://github.com/DTStack/dt-sql-parser/commit/4af913cf301d61e7ce9652cf47669bfa87a6b84b)) -* FlinkSQL supports auto complete ([#115](https://github.com/DTStack/dt-sql-parser/issues/115)) ([1b02ff5](https://github.com/DTStack/dt-sql-parser/commit/1b02ff5d7582bf626f9bef5ea1c1f0e65732d23e)) -* **flink:** support insert multipe tables statement for FlinkSQL 1.15([#104](https://github.com/DTStack/dt-sql-parser/issues/104)) ([c409b80](https://github.com/DTStack/dt-sql-parser/commit/c409b80ee1a3b1df92fab522442f3425d984d8c7)) -* **flink:** support NOT NULL syntax ([#103](https://github.com/DTStack/dt-sql-parser/issues/103)) ([4b824fb](https://github.com/DTStack/dt-sql-parser/commit/4b824fb50004c0938171d887a21e761fdb62df89)) -* improve flinksql createStatement ([#91](https://github.com/DTStack/dt-sql-parser/issues/91)) ([370cccf](https://github.com/DTStack/dt-sql-parser/commit/370cccf8d9328aabccba1c9140a2adea395783f7)) -* improve flinksql insertStatement ([dc417e1](https://github.com/DTStack/dt-sql-parser/commit/dc417e1381ca52525037b215a153df28ddc81272)) -* replace fliePath with slashText to resolve conflict between filePath and arithmetic ([#112](https://github.com/DTStack/dt-sql-parser/issues/112)) ([793ff6e](https://github.com/DTStack/dt-sql-parser/commit/793ff6ef0e10e502eeb61ad8e40ccfe05ae50929)) -* support trino(presto) sql language ([#105](https://github.com/DTStack/dt-sql-parser/issues/105)) ([9c82a5d](https://github.com/DTStack/dt-sql-parser/commit/9c82a5d248e9d94479045ad7b248e4a785e62e92)) -* update alter and drop statements ([#94](https://github.com/DTStack/dt-sql-parser/issues/94)) ([fbee70c](https://github.com/DTStack/dt-sql-parser/commit/fbee70cde54fcec773cf35f858016c1a23459cc0)) -* update the builtin funcs of flinksql ([#102](https://github.com/DTStack/dt-sql-parser/issues/102)) ([0924acf](https://github.com/DTStack/dt-sql-parser/commit/0924acf730df41866be18f82172a58854f3bb0a3)) -* upgrade antlr4 to 4.12.0 ([#88](https://github.com/DTStack/dt-sql-parser/issues/88)) ([c1c72de](https://github.com/DTStack/dt-sql-parser/commit/c1c72def30a2df90182290fb2e5bc64265dfa3c3)) - - -### Bug Fixes - -* correct the grammar usage, especially in the parts targeting javascript ([#109](https://github.com/DTStack/dt-sql-parser/issues/109)) ([eeb111b](https://github.com/DTStack/dt-sql-parser/commit/eeb111b5c5e06eb144d7679d4b813082537945d4)) -* ingore the unused errors of libs ([b39825e](https://github.com/DTStack/dt-sql-parser/commit/b39825e31a4d25dc4ab2a0c6fb12d84d55944b12)) -* rename to TrinoSqlParser ([46a8a7a](https://github.com/DTStack/dt-sql-parser/commit/46a8a7ab125638b5e2dd6067d8b74b0f90ff543d)) -* rename TrinoSqlParser to TrinoSql ([8084c79](https://github.com/DTStack/dt-sql-parser/commit/8084c7919a5e1d982556d4684abfad6afa58c124)) -* rename TrinoSqlVisitor ([76d7ee5](https://github.com/DTStack/dt-sql-parser/commit/76d7ee5e7074b5549e791e529dc925ab32b51f4a)) -* update the exports path of trino ([1442ad6](https://github.com/DTStack/dt-sql-parser/commit/1442ad66d73144b4f4d29ed899f4dc7406cbff1f)) - ## [4.0.0-beta.3.2](https://github.com/DTStack/dt-sql-parser/compare/v4.0.0-beta.3.1...v4.0.0-beta.3.2) (2023-01-09) ## [4.0.0-beta.3.1](https://github.com/DTStack/dt-sql-parser/compare/v4.0.0-beta.3...v4.0.0-beta.3.1) (2022-12-30) - ### Bug Fixes * fix bracket match ([e446fc0](https://github.com/DTStack/dt-sql-parser/commit/e446fc0435eb21c4a931db161c9c3a25dc8edb2b)) @@ -44,7 +15,6 @@ All notable changes to this project will be documented in this file. See [standa ## [4.0.0-beta.2.2](https://github.com/DTStack/dt-sql-parser/compare/v4.0.0-beta.2.1...v4.0.0-beta.2.2) (2021-09-10) - ### Features * add Bracket, Comma, and FunctionArguments tokens ([b1ae454](https://github.com/DTStack/dt-sql-parser/commit/b1ae454ae4f8cc78071a5708486bd0f6dc96d29c)) diff --git a/README.md b/README.md index 3896aca..edf7227 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ English | [简体中文](./README-zh_CN.md) [online-chat-img]: https://img.shields.io/discord/920616811261743104?logo=Molecule [online-chat-url]: https://discord.gg/uVvq6mfPfa - dt-sql-parser is a **SQL Parser** project built with [ANTLR4](https://github.com/antlr/antlr4), and it's mainly for the **BigData** domain. The [ANTLR4](https://github.com/antlr/antlr4) generated the basic Parser, Visitor, and Listener, so it's easy to complete the **syntax validation**, **tokenizer**, **traverse** the AST, and so on features. Besides, it provides some helper methods, like **split** SQL, and filter the `--` and `/**/` types of comments in SQL. @@ -55,7 +54,7 @@ different Parser, so if you need to handle the **Flink SQL**, you can import the The below is a **GenericSQL Parser** example: ```javascript -import { GenericSQL } from 'dt-sql-parser'; +import GenericSQL from 'dt-sql-parser/dist/parser/generic'; const parser = new GenericSQL(); @@ -104,7 +103,7 @@ returns an array object includes **error** message. Get all **tokens** by the Parser: ```javascript -import { GenericSQL } from 'dt-sql-parser'; +import GenericSQL from 'dt-sql-parser/dist/parser/generic'; const parser = new GenericSQL() const sql = 'select id,name,sex from user1;' @@ -133,7 +132,8 @@ console.log(tokens) Traverse the tree node by the Visitor: ```javascript -import { GenericSQL, SqlParserVisitor } from 'dt-sql-parser'; +import GenericSQL from 'dt-sql-parser/dist/parser/generic'; +import { SqlParserVisitor } from 'dt-sql-parser/dist/parser/generic/SqlParserVisitor'; const parser = new GenericSQL() const sql = `select id,name from user1;` @@ -168,7 +168,8 @@ TableName user1 Access the specified node in the AST by the Listener ```javascript -import { GenericSQL, SqlParserListener } from 'dt-sql-parser'; +import GenericSQL from 'dt-sql-parser/dist/parser/generic'; +import { SqlParserListener } from 'dt-sql-parser/dist/parser/generic/SqlParserListener'; const parser = new GenericSQL(); const sql = 'select id,name from user1;' diff --git a/test/parser/flinksql/benchmark/benchmark.md b/test/parser/flinksql/benchmark/benchmark.md index 7d5aaa1..ca69082 100644 --- a/test/parser/flinksql/benchmark/benchmark.md +++ b/test/parser/flinksql/benchmark/benchmark.md @@ -1,12 +1,12 @@ # FlinkSQL Benchmark | Name | Rows | Times | Total Time(ms) | Average Time(ms) | | ---- | ---- | ---- | ---- | ---- | -| CreateTable | 100 | 1 | 208.57 | 208.57 | -| CreateTable | 1000 | 1 | 336.50 | 336.50 | -| CreateTable | 5000 | 1 | 1798.17 | 1798.17 | -| SelectTable | 100 | 1 | 327.30 | 327.30 | -| SelectTable | 1000 | 1 | 833.60 | 833.60 | -| SelectTable | 5000 | 1 | 4058.11 | 4058.11 | -| InsertTable | 100 | 1 | 10.45 | 10.45 | -| InsertTable | 1000 | 1 | 45.08 | 45.08 | -| InsertTable | 5000 | 1 | 259.14 | 259.14 | \ No newline at end of file +| CreateTable | 100 | 1 | 3858.63 | 3858.63 | +| CreateTable | 1000 | 1 | 4845.70 | 4845.70 | +| CreateTable | 5000 | 1 | 14629.31 | 14629.31 | +| SelectTable | 100 | 1 | 3796.21 | 3796.21 | +| SelectTable | 1000 | 1 | 7207.75 | 7207.75 | +| SelectTable | 5000 | 1 | 26171.22 | 26171.22 | +| InsertTable | 100 | 1 | 57.62 | 57.62 | +| InsertTable | 1000 | 1 | 111.11 | 111.11 | +| InsertTable | 5000 | 1 | 2056.96 | 2056.96 | \ No newline at end of file