phoenix-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [phoenix] swaroopak commented on a change in pull request #508: PHOENIX-5283: Add CASCADE INDEX ALL in the SQL Grammar of ALTER TABLE…
Date Fri, 17 May 2019 20:54:53 GMT
swaroopak commented on a change in pull request #508: PHOENIX-5283: Add CASCADE INDEX ALL in
the SQL Grammar of ALTER TABLE…
URL: https://github.com/apache/phoenix/pull/508#discussion_r285285858
 
 

 ##########
 File path: phoenix-core/src/main/java/org/apache/phoenix/schema/MetaDataClient.java
 ##########
 @@ -3524,14 +3525,20 @@ private void mutateStringProperty(String tenantId, String schemaName,
String tab
 
     public MutationState addColumn(AddColumnStatement statement) throws SQLException {
         PTable table = FromCompiler.getResolver(statement, connection).getTables().get(0).getTable();
-        return addColumn(table, statement.getColumnDefs(), statement.getProps(), statement.ifNotExists(),
false, statement.getTable(), statement.getTableType());
+        return addColumn(table, statement.getColumnDefs(), statement.getProps(), statement.ifNotExists(),
false, statement.getTable(), statement.getTableType(), statement.isCascade(), statement.getIndexes());
     }
 
     public MutationState addColumn(PTable table, List<ColumnDef> origColumnDefs,
             ListMultimap<String, Pair<String, Object>> stmtProperties, boolean
ifNotExists,
-            boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType)
+            boolean removeTableProps, NamedTableNode namedTableNode, PTableType tableType,
boolean cascade, List<NamedNode> indexes)
                     throws SQLException {
         connection.rollback();
+        if(cascade || indexes == null || indexes.size()>0) {
 
 Review comment:
   Invalid grammar/statement related exceptions will be handled by parser logic. I ll add
more UT on this. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message