priyankporwal commented on a change in pull request #514: PHOENIX-5261:
Implement ALTER TABLE/VIEW ADD COLUMN CASCADE
URL: https://github.com/apache/phoenix/pull/514#discussion_r291376232
##########
File path: phoenix-core/src/main/antlr3/PhoenixSQL.g
##########
@@ -656,8 +656,8 @@ alter_session_node returns [AlterSessionStatement ret]
// Parse an alter table statement.
alter_table_node returns [AlterTableStatement ret]
: ALTER (TABLE | v=VIEW) t=from_table_name
- ( (DROP COLUMN (IF ex=EXISTS)? c=column_names) | (ADD (IF NOT
ex=EXISTS)? (d=column_defs) (p=fam_properties)?) | (SET (p=fam_properties)) )
- { PTableType tt = v==null ?
(QueryConstants.SYSTEM_SCHEMA_NAME.equals(t.getSchemaName()) ?
PTableType.SYSTEM : PTableType.TABLE) : PTableType.VIEW; ret = ( c == null ?
factory.addColumn(factory.namedTable(null,t), tt, d, ex!=null, p) :
factory.dropColumn(factory.namedTable(null,t), tt, c, ex!=null) ); }
+ ( (DROP COLUMN (IF ex=EXISTS)? c=column_names) | (ADD (IF NOT
ex=EXISTS)? (d=column_defs) (p=fam_properties)?) (cas=CASCADE INDEX
(list=indexes | all=ALL))? | (SET (p=fam_properties)) )
+ { PTableType tt = v==null ?
(QueryConstants.SYSTEM_SCHEMA_NAME.equals(t.getSchemaName()) ?
PTableType.SYSTEM : PTableType.TABLE) : PTableType.VIEW; ret = ( c == null ?
factory.addColumn(factory.namedTable(null,t), tt, d, ex!=null, p, cas!=null,
(all == null ? list : null)) : factory.dropColumn(factory.namedTable(null,t),
tt, c, ex!=null) ); }
Review comment:
(all == null ? list : null) ... Don't this need to be (all == null ? null :
list) instead?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services