Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check spelling errors for all sql g4 #396

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/grammar/flink/FlinkSqlLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,11 @@ REVERSE_QUOTE_SYMB : '`';
COLON_SYMB : ':';
ASTERISK_SIGN : '*';
UNDERLINE_SIGN : '_';
HYPNEN_SIGN : '-';
HYPHEN_SIGN : '-';
ADD_SIGN : '+';
PENCENT_SIGN : '%';
PERCENT_SIGN : '%';
DOUBLE_VERTICAL_SIGN : '||';
DOUBLE_HYPNEN_SIGN : '--';
DOUBLE_HYPHEN_SIGN : '--';
SLASH_SIGN : '/';
QUESTION_MARK_SIGN : '?';
DOUBLE_RIGHT_ARROW : '=>';
Expand Down
84 changes: 42 additions & 42 deletions src/grammar/flink/FlinkSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ sqlStatement
| describeStatement
| explainStatement
| useStatement
| showStatememt
| showStatement
| loadStatement
| unloadStatememt
| setStatememt
| resetStatememt
| jarStatememt
| unloadStatement
| setStatement
| resetStatement
| jarStatement
| dtAddStatement
;

Expand Down Expand Up @@ -64,7 +64,7 @@ dmlStatement
| insertStatement
;

// some statemen
// some statement
describeStatement
: (KW_DESCRIBE | KW_DESC) tablePath
;
Expand Down Expand Up @@ -97,7 +97,7 @@ useModuleStatement
: KW_USE KW_MODULES uid (COMMA uid)*
;

showStatememt
showStatement
: KW_SHOW (KW_CATALOGS | KW_DATABASES | KW_VIEWS | KW_JARS)
| KW_SHOW KW_CURRENT (KW_CATALOG | KW_DATABASE)
| KW_SHOW KW_TABLES (( KW_FROM | KW_IN) databasePath)? likePredicate?
Expand All @@ -111,19 +111,19 @@ loadStatement
: KW_LOAD KW_MODULE uid (KW_WITH tablePropertyList)?
;

unloadStatememt
unloadStatement
: KW_UNLOAD KW_MODULE uid
;

setStatememt
setStatement
: KW_SET (tableProperty)?
;

resetStatememt
resetStatement
: KW_RESET tablePropertyKey?
;

jarStatememt
jarStatement
: (KW_ADD | KW_REMOVE) KW_JAR jarFileName
;

Expand Down Expand Up @@ -338,7 +338,7 @@ jarFileName
;

// Alter statements
// Just for simple alter table statements,
// Just for simple alter table statements,
// it only includes rename, set key, add constraint, drop constraint, add unique

alterTable
Expand Down Expand Up @@ -449,15 +449,15 @@ insertMulStatement
// Select statements

queryStatement
: valuesCaluse
: valuesClause
| withClause queryStatement
| LR_BRACKET queryStatement RR_BRACKET
| left=queryStatement operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT) KW_ALL? right=queryStatement orderByCaluse? limitClause?
| selectClause orderByCaluse? limitClause?
| selectStatement orderByCaluse? limitClause?
| left=queryStatement operator=(KW_INTERSECT | KW_UNION | KW_EXCEPT) KW_ALL? right=queryStatement orderByClause? limitClause?
| selectClause orderByClause? limitClause?
| selectStatement orderByClause? limitClause?
;

valuesCaluse
valuesClause
: KW_VALUES expression (COMMA expression)*
;

Expand Down Expand Up @@ -505,7 +505,7 @@ tableExpression
| tableExpression KW_NATURAL? (KW_LEFT | KW_RIGHT | KW_FULL | KW_INNER)? KW_OUTER? KW_JOIN tableExpression joinCondition?
| tableExpression KW_CROSS KW_JOIN tableExpression
| inlineDataValueClause
| windoTVFClause
| windowTVFClause
;

tableReference
Expand All @@ -532,15 +532,15 @@ inlineDataValueClause
: LR_BRACKET valuesDefinition RR_BRACKET tableAlias
;

windoTVFClause
: KW_TABLE LR_BRACKET windowTVFExression RR_BRACKET
windowTVFClause
: KW_TABLE LR_BRACKET windowTVFExpression RR_BRACKET
;

windowTVFExression
: windoTVFName LR_BRACKET windowTVFParam (COMMA windowTVFParam)* RR_BRACKET
windowTVFExpression
: windowTVFName LR_BRACKET windowTVFParam (COMMA windowTVFParam)* RR_BRACKET
;

windoTVFName
windowTVFName
: KW_TUMBLE
| KW_HOP
| KW_CUMULATE
Expand Down Expand Up @@ -586,7 +586,7 @@ groupItemDefinition
| groupWindowFunction
| LR_BRACKET RR_BRACKET
| LR_BRACKET expression (COMMA expression)* RR_BRACKET
| groupingSetsNotaionName LR_BRACKET expression (COMMA expression)* RR_BRACKET
| groupingSetsNotationName LR_BRACKET expression (COMMA expression)* RR_BRACKET
| groupingSets LR_BRACKET groupItemDefinition (COMMA groupItemDefinition)* RR_BRACKET
| expression
;
Expand All @@ -595,7 +595,7 @@ groupingSets
: KW_GROUPING KW_SETS
;

groupingSetsNotaionName
groupingSetsNotationName
: KW_CUBE
| KW_ROLLUP
;
Expand Down Expand Up @@ -627,19 +627,19 @@ namedWindow
;

windowSpec
: name=errorCapturingIdentifier? LR_BRACKET partitionByClause? orderByCaluse? windowFrame? RR_BRACKET
: name=errorCapturingIdentifier? LR_BRACKET partitionByClause? orderByClause? windowFrame? RR_BRACKET
;

matchRecognizeClause
: KW_MATCH_RECOGNIZE LR_BRACKET partitionByClause? orderByCaluse? measuresClause? outputMode? afterMatchStrategy? patternDefination?
patternVariablesDefination RR_BRACKET (KW_AS? identifier)?
: KW_MATCH_RECOGNIZE LR_BRACKET partitionByClause? orderByClause? measuresClause? outputMode? afterMatchStrategy? patternDefinition?
patternVariablesDefinition RR_BRACKET (KW_AS? identifier)?
;

orderByCaluse
: KW_ORDER KW_BY orderItemDefition (COMMA orderItemDefition)*
orderByClause
: KW_ORDER KW_BY orderItemDefinition (COMMA orderItemDefinition)*
;

orderItemDefition
orderItemDefinition
: columnName ordering=(KW_ASC | KW_DESC)? (KW_NULLS nullOrder=(KW_LAST | KW_FIRST))?
;

Expand All @@ -664,7 +664,7 @@ measuresClause
: KW_MEASURES projectItemDefinition (COMMA projectItemDefinition)*
;

patternDefination
patternDefinition
: KW_PATTERN LR_BRACKET patternVariable+ RR_BRACKET withinClause?
;

Expand All @@ -684,7 +684,7 @@ afterMatchStrategy
| KW_AFTER KW_MATCH KW_SKIP KW_TO KW_FIRST unquotedIdentifier
;

patternVariablesDefination
patternVariablesDefinition
: KW_DEFINE projectItemDefinition (COMMA projectItemDefinition)*
;

Expand Down Expand Up @@ -738,9 +738,9 @@ likePredicate

valueExpression
: primaryExpression # valueExpressionDefault
| operator=(HYPNEN_SIGN | ADD_SIGN | BIT_NOT_OP) valueExpression # arithmeticUnary
| left=valueExpression operator=(ASTERISK_SIGN | SLASH_SIGN | PENCENT_SIGN | KW_DIV) right=valueExpression # arithmeticBinary
| left=valueExpression operator=(ADD_SIGN | HYPNEN_SIGN | DOUBLE_VERTICAL_SIGN) right=valueExpression # arithmeticBinary
| operator=(HYPHEN_SIGN | ADD_SIGN | BIT_NOT_OP) valueExpression # arithmeticUnary
| left=valueExpression operator=(ASTERISK_SIGN | SLASH_SIGN | PERCENT_SIGN | KW_DIV) right=valueExpression # arithmeticBinary
| left=valueExpression operator=(ADD_SIGN | HYPHEN_SIGN | DOUBLE_VERTICAL_SIGN) right=valueExpression # arithmeticBinary
| left=valueExpression operator=BIT_AND_OP right=valueExpression # arithmeticBinary
| left=valueExpression operator=BIT_XOR_OP right=valueExpression # arithmeticBinary
| left=valueExpression operator=BIT_OR_OP right=valueExpression # arithmeticBinary
Expand Down Expand Up @@ -853,7 +853,7 @@ unitToUnitInterval
;

intervalValue
: (ADD_SIGN | HYPNEN_SIGN)? (DIG_LITERAL | REAL_LITERAL)
: (ADD_SIGN | HYPHEN_SIGN)? (DIG_LITERAL | REAL_LITERAL)
| STRING_LITERAL
;

Expand Down Expand Up @@ -999,26 +999,26 @@ bitOperator
mathOperator
: ASTERISK_SIGN
| SLASH_SIGN
| PENCENT_SIGN
| PERCENT_SIGN
| KW_DIV
| ADD_SIGN
| HYPNEN_SIGN
| DOUBLE_HYPNEN_SIGN
| HYPHEN_SIGN
| DOUBLE_HYPHEN_SIGN
;

unaryOperator
: EXCLAMATION_SYMBOL
| BIT_NOT_OP
| ADD_SIGN
| HYPNEN_SIGN
| HYPHEN_SIGN
| KW_NOT
;

constant
: timeIntervalExpression
| timePointLiteral
| stringLiteral // 引号包含的字符串
| HYPNEN_SIGN? decimalLiteral // 正/负整数
| HYPHEN_SIGN? decimalLiteral // 正/负整数
| booleanLiteral // 布尔值
| REAL_LITERAL // 小数
| BIT_STRING
Expand Down
10 changes: 5 additions & 5 deletions src/grammar/hive/HiveSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ explainOption
| KW_REOPTIMIZATION
| KW_LOCKS
| KW_AST
| KW_VECTORIZATION KW_ONLY? vectorizatonDetail?
| KW_VECTORIZATION KW_ONLY? vectorizationDetail?
| KW_DEBUG
| KW_DDL
;

vectorizatonDetail
vectorizationDetail
: KW_SUMMARY
| KW_OPERATOR
| KW_EXPRESSION
Expand Down Expand Up @@ -415,10 +415,10 @@ privObjectCols
;

privilegeList
: privlegeDef (COMMA privlegeDef)*
: privilegeDef (COMMA privilegeDef)*
;

privlegeDef
privilegeDef
: privilegeType (LPAREN cols=columnNameList RPAREN)?
;

Expand Down Expand Up @@ -663,7 +663,7 @@ recordWriter

rowFormatSerde
: KW_ROW KW_FORMAT KW_SERDE name=StringLiteral (
KW_WITH KW_SERDEPROPERTIES serdeprops=tableProperties
KW_WITH KW_SERDEPROPERTIES serderops=tableProperties
)?
;

Expand Down
4 changes: 2 additions & 2 deletions src/grammar/impala/ImpalaSqlParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ createFunction

alterStatement
: alterDatabase
| alterUnSetOrSetViewTblproperties
| alterUnSetOrSetViewTblProperties
| renameTable
| alterViewOwner
| alterView
Expand Down Expand Up @@ -241,7 +241,7 @@ renameTable
: KW_ALTER KW_TABLE tableNamePath KW_RENAME KW_TO tableNamePath
;

alterUnSetOrSetViewTblproperties
alterUnSetOrSetViewTblProperties
: KW_ALTER KW_VIEW viewNamePath (KW_UNSET | KW_SET) KW_TBLPROPERTIES tblProp=properties
;

Expand Down
Loading