Repository: phoenix Updated Branches: refs/heads/calcite e415755a8 -> 877a03cd4
PHOENIX-3617 Fix CREATE TABLE DDL parsing issues in Phoenix Calcaite-addendum(Rajeshbabu) Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/877a03cd Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/877a03cd Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/877a03cd Branch: refs/heads/calcite Commit: 877a03cd4b0973f57ffbbbdf88dfe0fe92f09487 Parents: e415755 Author: Rajeshbabu Chintaguntla <[email protected]> Authored: Tue Jan 24 22:05:42 2017 +0530 Committer: Rajeshbabu Chintaguntla <[email protected]> Committed: Tue Jan 24 22:05:42 2017 +0530 ---------------------------------------------------------------------- phoenix-core/src/main/codegen/data/Parser.tdd | 12 +++++----- .../src/main/codegen/includes/parserImpls.ftl | 23 ++++++-------------- 2 files changed, 13 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/877a03cd/phoenix-core/src/main/codegen/data/Parser.tdd ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/codegen/data/Parser.tdd b/phoenix-core/src/main/codegen/data/Parser.tdd index 5a1885c..9f253dc 100644 --- a/phoenix-core/src/main/codegen/data/Parser.tdd +++ b/phoenix-core/src/main/codegen/data/Parser.tdd @@ -73,12 +73,12 @@ "SqlDropIndex()", "SqlDropSequence()", "SqlUpdateStatistics()", - "SqlDropFunction()" - "SqlUploadJarsNode()" - "SqlDeleteJarNode()" - "SqlAlterTable()" - "SqlCreateSchema()" - "SqlDropSchema()" + "SqlDropFunction()", + "SqlUploadJarsNode()", + "SqlDeleteJarNode()", + "SqlAlterTable()", + "SqlCreateSchema()", + "SqlDropSchema()", "SqlUseSchema()" ] http://git-wip-us.apache.org/repos/asf/phoenix/blob/877a03cd/phoenix-core/src/main/codegen/includes/parserImpls.ftl ---------------------------------------------------------------------- diff --git a/phoenix-core/src/main/codegen/includes/parserImpls.ftl b/phoenix-core/src/main/codegen/includes/parserImpls.ftl index af5abd2..afebe85 100644 --- a/phoenix-core/src/main/codegen/includes/parserImpls.ftl +++ b/phoenix-core/src/main/codegen/includes/parserImpls.ftl @@ -124,7 +124,7 @@ SqlNode SqlCreateTable() : { SqlParserPos pos; SqlIdentifier tableName; - boolean immutable; + boolean immutable = false; boolean ifNotExists; SqlNodeList columnDefs; SqlIdentifier pkConstraint; @@ -133,15 +133,10 @@ SqlNode SqlCreateTable() : SqlNodeList splitKeys; } { - <CREATE> - ( + <CREATE> { pos = getPos(); } + [ <IMMUTABLE> { immutable = true; } - | - { - immutable = false; - } - ) - { pos = getPos(); } + ] <TABLE> ( <IF> <NOT> <EXISTS> { ifNotExists = true; } @@ -474,17 +469,13 @@ SqlNode SqlCreateSchema() : { SqlParserPos pos; SqlIdentifier schemaName; - boolean ifNotExists; + boolean ifNotExists = false; } { <CREATE> { pos = getPos(); } <SCHEMA> - ( + [ <IF> <NOT> <EXISTS> { ifNotExists = true; } - | - { - ifNotExists = false; - } - ) + ] schemaName = SimpleIdentifier() { return new SqlCreateSchema(pos.plus(getPos()), schemaName,
