smiklosovic commented on code in PR #3903: URL: https://github.com/apache/cassandra/pull/3903#discussion_r1958636037
########## src/java/org/apache/cassandra/cql3/constraints/ColumnConstraints.java: ########## @@ -101,9 +119,110 @@ public boolean hasRelevantConstraints() return false; } - public void checkInvalidConstraintsCombinations(ColumnIdentifier columnName) + public void checkInvalidConstraintsCombinations(ColumnIdentifier columnName, AbstractType<?> type) { - // TODO check duplicities etc CASSANDRA-20330 + Set<String> constraintNames = new TreeSet<>(); + Set<String> duplicateConstraints = new TreeSet<>(); + List<ColumnConstraint<?>> scalarConstraints = new LinkedList<>(); + List<ScalarColumnConstraint> notEquals = new LinkedList<>(); + for (ColumnConstraint<?> columnConstraint : constraints) + { + String constraintName = columnConstraint.name(); + if (!constraintNames.add(constraintName)) + { + if (columnConstraint.getConstraintType() == ConstraintType.SCALAR) + { + ScalarColumnConstraint scalarColumnConstraint = (ScalarColumnConstraint) columnConstraint; + Operator operator = scalarColumnConstraint.relationType(); + if (operator != NEQ) Review Comment: Then we would need to have a register of constraints which support `!=` operator and iterate over them. -- 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