beobal commented on code in PR #3921:
URL: https://github.com/apache/cassandra/pull/3921#discussion_r1974084144


##########
src/antlr/Parser.g:
##########
@@ -980,7 +980,7 @@ alterTableStatement returns [AlterTableStatement.Raw stmt]
       | K_ALTER ( K_IF K_EXISTS { $stmt.ifColumnExists(true); } )? id=cident
               ( mask=columnMask { $stmt.mask(id, mask); }
               | K_DROP K_MASKED { $stmt.mask(id, null); }
-              | K_DROP K_CHECK { $stmt.dropConstraints(id); }
+              | K_DROP K_CHECK { $stmt.alterConstraints(id, null); }
               | (constraints=columnConstraints) { $stmt.alterConstraints(id, 
constraints); })

Review Comment:
   I don't think it's worth a JIRA to change the name of an internal method. If 
you don't disagree with the suggestion, why not just change it here?



##########
src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:
##########
@@ -739,9 +739,9 @@ public KeyspaceMetadata apply(Epoch epoch, KeyspaceMetadata 
keyspace, TableMetad
     public static class AlterConstraints extends AlterTableStatement
     {
         final ColumnIdentifier columnName;
-        final ColumnConstraints constraints;
+        final ColumnConstraints.Raw constraints;
 
-        AlterConstraints(String keyspaceName, String tableName, boolean 
ifTableExists, ColumnIdentifier columnName, ColumnConstraints constraints)
+        AlterConstraints(String keyspaceName, String tableName, boolean 
ifTableExists, ColumnIdentifier columnName, ColumnConstraints.Raw constraints)

Review Comment:
   It is also silent when the `IF EXISTS` is not supplied though (i.e. when it 
_should_ error). You should probably do something similar to the other 
implementations of `AlterTableStatement`:
   ```
               ColumnMetadata currentColumn = table.getColumn(column);
               if (null == currentColumn) {
                   if (!ifExists)
                       throw ire("Column %s was not found in table '%s'", 
column, table);
                   return;
               }
   ```



-- 
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.

To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to