You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2021/12/01 12:54:23 UTC

[GitHub] [cassandra] blerer commented on a change in pull request #1319: modify alter statements with IF EXISTS and IF NOT EXISTS

blerer commented on a change in pull request #1319:
URL: https://github.com/apache/cassandra/pull/1319#discussion_r760156290



##########
File path: src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java
##########
@@ -93,7 +94,12 @@ public Keyspaces apply(Keyspaces schema) throws UnknownHostException
                             : keyspace.getTableOrViewNullable(tableName);
 
         if (null == table)
+        {
+            if (ifTableExists)
+                return schema;

Review comment:
       What I meant was:
   
   ```
   if (!ifExists)
       throw ire("Table '%s.%s' doesn't exist", keyspaceName, tableName);
   
   return schema; 
   ```
   but your initial solution is also fine.   




-- 
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-unsubscribe@cassandra.apache.org

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



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