gokceni 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_r290962171
##########
File path:
phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
##########
@@ -3693,6 +3706,25 @@ public MutationState addColumn(PTable table,
List<ColumnDef> origColumnDefs,
.setTableName(tableName).build().buildException();
}
PColumn column = newColumn(position++, colDef,
PrimaryKeyConstraint.EMPTY, table.getDefaultFamilyName() == null ? null :
table.getDefaultFamilyName().getString(), true, columnQualifierBytes,
willBeImmutableRows);
+ HashMap<PTable, PColumn> indexColumn = null;
+ if (cascade && !colDef.isPK() && numIndexes>0) {
Review comment:
Perhaps just do and outer if on cascade to make it more readable and
maintainable.
if (cascade) {
if (colDef.isPK) {
throw Ex
}
for (PTable :) {
}
}
----------------------------------------------------------------
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