Feat/hive ddl (#150)
* test: test cases about Alter Either Table or Partition * feat: support alter protection and correct alter compact * feat: improve keyword rules * feat: recompile hive grammar
This commit is contained in:
@ -42,7 +42,7 @@ KW_AST : 'AST';
|
||||
KW_AT : 'AT';
|
||||
KW_AUTHORIZATION : 'AUTHORIZATION';
|
||||
KW_AUTOCOMMIT : 'AUTOCOMMIT';
|
||||
KW_BATCH : 'KW_BATCH';
|
||||
KW_BATCH : 'BATCH';
|
||||
KW_BEFORE : 'BEFORE';
|
||||
KW_BETWEEN : 'BETWEEN';
|
||||
KW_BIGINT : 'BIGINT';
|
||||
@ -93,7 +93,7 @@ KW_DATACONNECTORS : 'CONNECTORS';
|
||||
KW_DATE : 'DATE';
|
||||
KW_DATETIME : 'DATETIME';
|
||||
KW_DAY : 'DAY' 'S'?;
|
||||
KW_DAYOFWEEK : 'KW_DAYOFWEEK';
|
||||
KW_DAYOFWEEK : 'DAYOFWEEK';
|
||||
KW_DBPROPERTIES : 'DBPROPERTIES';
|
||||
KW_DCPROPERTIES : 'DCPROPERTIES';
|
||||
KW_DDL : 'DDL';
|
||||
@ -116,7 +116,6 @@ KW_DISTRIBUTE : 'DISTRIBUTE';
|
||||
KW_DISTRIBUTED : 'DISTRIBUTED';
|
||||
KW_DO : 'DO';
|
||||
KW_DOUBLE : 'DOUBLE';
|
||||
KW_DOW : 'DAYOFWEEK';
|
||||
KW_DROP : 'DROP';
|
||||
KW_DUMP : 'DUMP';
|
||||
KW_ELEM_TYPE : '$ELEM$';
|
||||
@ -161,7 +160,7 @@ KW_GRANT : 'GRANT';
|
||||
KW_GROUP : 'GROUP';
|
||||
KW_GROUPING : 'GROUPING';
|
||||
KW_HAVING : 'HAVING';
|
||||
KW_HOLD_DDLTIME : 'KW_HOLD_DDLTIME';
|
||||
KW_HOLD_DDLTIME : 'HOLD_DDLTIME';
|
||||
KW_HOUR : 'HOUR' 'S'?;
|
||||
KW_IDXPROPERTIES : 'IDXPROPERTIES';
|
||||
KW_IF : 'IF';
|
||||
@ -227,11 +226,11 @@ KW_NORELY : 'NORELY';
|
||||
KW_NOSCAN : 'NOSCAN';
|
||||
KW_NOT : 'NOT' | '!';
|
||||
KW_NOVALIDATE : 'NOVALIDATE';
|
||||
KW_NO_DROP : 'KW_NO_DROP';
|
||||
KW_NO_DROP : 'NO_DROP';
|
||||
KW_NULL : 'NULL';
|
||||
KW_NULLS : 'NULLS';
|
||||
KW_OF : 'OF';
|
||||
KW_OFFLINE : 'KW_OFFLINE';
|
||||
KW_OFFLINE : 'OFFLINE';
|
||||
KW_OFFSET : 'OFFSET';
|
||||
KW_ON : 'ON';
|
||||
KW_ONLY : 'ONLY';
|
||||
@ -263,7 +262,7 @@ KW_PRESERVE : 'PRESERVE';
|
||||
KW_PRIMARY : 'PRIMARY';
|
||||
KW_PRINCIPALS : 'PRINCIPALS';
|
||||
KW_PROCEDURE : 'PROCEDURE';
|
||||
KW_PROTECTION : 'KW_PROTECTION';
|
||||
KW_PROTECTION : 'PROTECTION';
|
||||
KW_PURGE : 'PURGE';
|
||||
KW_QUALIFY : 'QUALIFY';
|
||||
KW_QUARTER : 'QUARTER';
|
||||
@ -271,7 +270,7 @@ KW_QUERY : 'QUERY';
|
||||
KW_QUERY_PARALLELISM : 'QUERY_PARALLELISM';
|
||||
KW_RANGE : 'RANGE';
|
||||
KW_READ : 'READ';
|
||||
KW_READONLY : 'KW_READONLY';
|
||||
KW_READONLY : 'READONLY';
|
||||
KW_READS : 'READS';
|
||||
KW_REAL : 'REAL';
|
||||
KW_REBUILD : 'REBUILD';
|
||||
@ -347,7 +346,7 @@ KW_THEN : 'THEN';
|
||||
KW_TIME : 'TIME';
|
||||
KW_TIMESTAMP : 'TIMESTAMP';
|
||||
KW_TIMESTAMPLOCALTZ : 'TIMESTAMPLOCALTZ';
|
||||
KW_TIMESTAMPTZ : 'KW_TIMESTAMPTZ';
|
||||
KW_TIMESTAMPTZ : 'TIMESTAMPTZ';
|
||||
KW_TINYINT : 'TINYINT';
|
||||
KW_TO : 'TO';
|
||||
KW_TOUCH : 'TOUCH';
|
||||
@ -503,6 +502,7 @@ QuotedIdentifier
|
||||
fragment
|
||||
Letter
|
||||
: 'A'..'Z'
|
||||
| 'a'..'z'
|
||||
;
|
||||
|
||||
fragment
|
||||
|
@ -1369,6 +1369,7 @@ alterTblPartitionStatementSuffix
|
||||
| alterStatementSuffixRenameCol
|
||||
| alterStatementSuffixAddCol
|
||||
| alterStatementSuffixUpdateColumns
|
||||
| alterStatementSuffixProtections
|
||||
;
|
||||
|
||||
alterStatementPartitionKeyType
|
||||
@ -1435,6 +1436,11 @@ alterStatementSuffixUpdateColumns
|
||||
: KW_UPDATE KW_COLUMNS restrictOrCascade?
|
||||
;
|
||||
|
||||
alterStatementSuffixProtections
|
||||
: enableSpecification KW_NO_DROP KW_CASCADE?
|
||||
| enableSpecification KW_OFFLINE
|
||||
;
|
||||
|
||||
alterStatementSuffixDropConstraint
|
||||
: KW_DROP KW_CONSTRAINT cName=id_
|
||||
;
|
||||
@ -1569,7 +1575,7 @@ compactPool
|
||||
;
|
||||
|
||||
alterStatementSuffixCompact
|
||||
: KW_COMPACT compactType=StringLiteral tableImplBuckets? blocking? compactPool? (KW_WITH KW_OVERWRITE KW_TBLPROPERTIES tableProperties)?
|
||||
: KW_COMPACT compactType=StringLiteral blocking? tableImplBuckets? orderByClause? compactPool? (KW_WITH KW_OVERWRITE KW_TBLPROPERTIES tableProperties)?
|
||||
;
|
||||
|
||||
alterStatementSuffixSetOwner
|
||||
@ -2184,7 +2190,6 @@ timeQualifiers
|
||||
| KW_MONTH
|
||||
| KW_WEEK
|
||||
| KW_DAY
|
||||
| KW_DOW
|
||||
| KW_HOUR
|
||||
| KW_MINUTE
|
||||
| KW_SECOND
|
||||
@ -2641,7 +2646,6 @@ nonReserved
|
||||
| KW_DISTRIBUTE
|
||||
| KW_DISTRIBUTED
|
||||
| KW_DO
|
||||
| KW_DOW
|
||||
| KW_DUMP
|
||||
| KW_ELEM_TYPE
|
||||
| KW_ENABLE
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@ -256,6 +256,7 @@ import { AlterStatementSuffixRenameContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixAddColContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixAddConstraintContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixUpdateColumnsContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixProtectionsContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixDropConstraintContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixRenameColContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixUpdateStatsColContext } from "./HiveSqlParser";
|
||||
@ -3295,6 +3296,17 @@ export interface HiveSqlParserListener extends ParseTreeListener {
|
||||
*/
|
||||
exitAlterStatementSuffixUpdateColumns?: (ctx: AlterStatementSuffixUpdateColumnsContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.alterStatementSuffixProtections`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
enterAlterStatementSuffixProtections?: (ctx: AlterStatementSuffixProtectionsContext) => void;
|
||||
/**
|
||||
* Exit a parse tree produced by `HiveSqlParser.alterStatementSuffixProtections`.
|
||||
* @param ctx the parse tree
|
||||
*/
|
||||
exitAlterStatementSuffixProtections?: (ctx: AlterStatementSuffixProtectionsContext) => void;
|
||||
|
||||
/**
|
||||
* Enter a parse tree produced by `HiveSqlParser.alterStatementSuffixDropConstraint`.
|
||||
* @param ctx the parse tree
|
||||
|
@ -256,6 +256,7 @@ import { AlterStatementSuffixRenameContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixAddColContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixAddConstraintContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixUpdateColumnsContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixProtectionsContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixDropConstraintContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixRenameColContext } from "./HiveSqlParser";
|
||||
import { AlterStatementSuffixUpdateStatsColContext } from "./HiveSqlParser";
|
||||
@ -2286,6 +2287,13 @@ export interface HiveSqlParserVisitor<Result> extends ParseTreeVisitor<Result> {
|
||||
*/
|
||||
visitAlterStatementSuffixUpdateColumns?: (ctx: AlterStatementSuffixUpdateColumnsContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.alterStatementSuffixProtections`.
|
||||
* @param ctx the parse tree
|
||||
* @return the visitor result
|
||||
*/
|
||||
visitAlterStatementSuffixProtections?: (ctx: AlterStatementSuffixProtectionsContext) => Result;
|
||||
|
||||
/**
|
||||
* Visit a parse tree produced by `HiveSqlParser.alterStatementSuffixDropConstraint`.
|
||||
* @param ctx the parse tree
|
||||
|
Reference in New Issue
Block a user