bbotella commented on code in PR #4022: URL: https://github.com/apache/cassandra/pull/4022#discussion_r2037398478
########## src/antlr/Parser.g: ########## @@ -795,9 +795,30 @@ columnConstraints returns [ColumnConstraints.Raw constraints] ; columnConstraint returns [ColumnConstraint columnConstraint] - : funcName=ident '(' k=ident ')' op=relationType t=value { $columnConstraint = new FunctionColumnConstraint.Raw(funcName, k, op, t.getText()).prepare(); } - | funcName=ident '(' k=ident ')' { $columnConstraint = new UnaryFunctionColumnConstraint.Raw(funcName, k).prepare(); } - | k=ident op=relationType t=value { $columnConstraint = new ScalarColumnConstraint.Raw(k, op, t.getText()).prepare(); } + @init { List<String> arguments = new ArrayList<>(); } + : K_NOT K_NULL Review Comment: Not for this PR, and don't know if worth doing, but here it goes yet another crazy idea... What about something like: ``` (K_NOT)? funcName=ident ``` With the `K_NOT` optional we can "negate" whatever the func does. This would allow us to reuse the `NOT` notation for all other constraints. A crazy example would be: ``` ALTER TABLE ks.tb ADD val3 text CHECK NOT JSON ``` -- 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