This commit is contained in:
Kijin-Seija 2024-08-26 16:59:41 +08:00
parent a5c6d2e1f8
commit ffb575e317
7 changed files with 16633 additions and 16535 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "dt-sql-parser-oushudb", "name": "dt-sql-parser-oushudb",
"version": "4.0.2-5", "version": "4.0.2-8",
"authors": "DTStack Corporation", "authors": "DTStack Corporation",
"description": "SQL Parsers for BigData, built with antlr4", "description": "SQL Parsers for BigData, built with antlr4",
"keywords": [ "keywords": [

View File

@ -668,11 +668,8 @@ KW_EXTENDED : 'EXTENDED';
KW_MAIN : 'MAIN'; KW_MAIN : 'MAIN';
KW_SKIP_LOCKED : 'SKIP_LOCKED'; KW_SKIP_LOCKED : 'SKIP_LOCKED';
KW_BUFFER_USAGE_LIMIT : 'BUFFER_USAGE_LIMIT'; KW_BUFFER_USAGE_LIMIT : 'BUFFER_USAGE_LIMIT';
// KW_DISTRIBUTED : 'DISTRIBUTED';
KW_WRITABLE : 'WRITABLE';
// My custom keywords
KW_DISTRIBUTED : 'DISTRIBUTED';
KW_WRITABLE : 'WRITABLE';
// //
// IDENTIFIERS (4.1.1) // IDENTIFIERS (4.1.1)

View File

@ -723,13 +723,23 @@ copy_generic_opt_arg_list_item
createstmt createstmt
: create_table_clause opt_if_not_exists? table_name_create ( : create_table_clause opt_if_not_exists? table_name_create (
OPEN_PAREN table_column_list? CLOSE_PAREN optinherit? optpartitionspec? table_access_method_clause? optwith? oncommitoption? opttablespace? optdistributed? OPEN_PAREN table_column_list? CLOSE_PAREN create_table_options*
| KW_OF any_name opttypedtableelementlist? optpartitionspec? table_access_method_clause? optwith? oncommitoption? opttablespace? | KW_OF any_name opttypedtableelementlist? optpartitionspec? table_access_method_clause? optwith? oncommitoption? opttablespace?
| KW_PARTITION KW_OF qualified_name opttypedtableelementlist? partitionboundspec optpartitionspec? table_access_method_clause? optwith? | KW_PARTITION KW_OF qualified_name opttypedtableelementlist? partitionboundspec optpartitionspec? table_access_method_clause? optwith?
oncommitoption? opttablespace? oncommitoption? opttablespace?
) # columnCreateTable ) # columnCreateTable
; ;
create_table_options
: optinherit
| optpartitionspec
| table_access_method_clause
| optwith
| oncommitoption
| opttablespace
| optdistributed
;
create_table_clause create_table_clause
: KW_CREATE opttemp? KW_WRITABLE? KW_EXTERNAL? KW_TABLE : KW_CREATE opttemp? KW_WRITABLE? KW_EXTERNAL? KW_TABLE
; ;

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -103,6 +103,7 @@ import { Copy_generic_opt_argContext } from "./PostgreSqlParser.js";
import { Copy_generic_opt_arg_listContext } from "./PostgreSqlParser.js"; import { Copy_generic_opt_arg_listContext } from "./PostgreSqlParser.js";
import { Copy_generic_opt_arg_list_itemContext } from "./PostgreSqlParser.js"; import { Copy_generic_opt_arg_list_itemContext } from "./PostgreSqlParser.js";
import { ColumnCreateTableContext } from "./PostgreSqlParser.js"; import { ColumnCreateTableContext } from "./PostgreSqlParser.js";
import { Create_table_optionsContext } from "./PostgreSqlParser.js";
import { Create_table_clauseContext } from "./PostgreSqlParser.js"; import { Create_table_clauseContext } from "./PostgreSqlParser.js";
import { OptdistributedContext } from "./PostgreSqlParser.js"; import { OptdistributedContext } from "./PostgreSqlParser.js";
import { OpttempContext } from "./PostgreSqlParser.js"; import { OpttempContext } from "./PostgreSqlParser.js";
@ -1854,6 +1855,16 @@ export class PostgreSqlParserListener implements ParseTreeListener {
* @param ctx the parse tree * @param ctx the parse tree
*/ */
exitColumnCreateTable?: (ctx: ColumnCreateTableContext) => void; exitColumnCreateTable?: (ctx: ColumnCreateTableContext) => void;
/**
* Enter a parse tree produced by `PostgreSqlParser.create_table_options`.
* @param ctx the parse tree
*/
enterCreate_table_options?: (ctx: Create_table_optionsContext) => void;
/**
* Exit a parse tree produced by `PostgreSqlParser.create_table_options`.
* @param ctx the parse tree
*/
exitCreate_table_options?: (ctx: Create_table_optionsContext) => void;
/** /**
* Enter a parse tree produced by `PostgreSqlParser.create_table_clause`. * Enter a parse tree produced by `PostgreSqlParser.create_table_clause`.
* @param ctx the parse tree * @param ctx the parse tree

View File

@ -103,6 +103,7 @@ import { Copy_generic_opt_argContext } from "./PostgreSqlParser.js";
import { Copy_generic_opt_arg_listContext } from "./PostgreSqlParser.js"; import { Copy_generic_opt_arg_listContext } from "./PostgreSqlParser.js";
import { Copy_generic_opt_arg_list_itemContext } from "./PostgreSqlParser.js"; import { Copy_generic_opt_arg_list_itemContext } from "./PostgreSqlParser.js";
import { ColumnCreateTableContext } from "./PostgreSqlParser.js"; import { ColumnCreateTableContext } from "./PostgreSqlParser.js";
import { Create_table_optionsContext } from "./PostgreSqlParser.js";
import { Create_table_clauseContext } from "./PostgreSqlParser.js"; import { Create_table_clauseContext } from "./PostgreSqlParser.js";
import { OptdistributedContext } from "./PostgreSqlParser.js"; import { OptdistributedContext } from "./PostgreSqlParser.js";
import { OpttempContext } from "./PostgreSqlParser.js"; import { OpttempContext } from "./PostgreSqlParser.js";
@ -1475,6 +1476,12 @@ export class PostgreSqlParserVisitor<Result> extends AbstractParseTreeVisitor<Re
* @return the visitor result * @return the visitor result
*/ */
visitColumnCreateTable?: (ctx: ColumnCreateTableContext) => Result; visitColumnCreateTable?: (ctx: ColumnCreateTableContext) => Result;
/**
* Visit a parse tree produced by `PostgreSqlParser.create_table_options`.
* @param ctx the parse tree
* @return the visitor result
*/
visitCreate_table_options?: (ctx: Create_table_optionsContext) => Result;
/** /**
* Visit a parse tree produced by `PostgreSqlParser.create_table_clause`. * Visit a parse tree produced by `PostgreSqlParser.create_table_clause`.
* @param ctx the parse tree * @param ctx the parse tree