[
https://issues.apache.org/jira/browse/CASSANDRA-17818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17731068#comment-17731068
]
Brandon Williams commented on CASSANDRA-17818:
----------------------------------------------
Here's a new CI run:
||Branch||CI||
|[3.11|https://github.com/driftx/cassandra/tree/CASSANDRA-17818-3.11]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1051/workflows/798aad94-f597-4b3e-9fd2-4a2831a69a92]|
|[4.0|https://github.com/driftx/cassandra/tree/CASSANDRA-17818-4.0]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1054/workflows/aaf8a8ec-99a4-48b2-a49c-8c8ccb6210d1],
[j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1054/workflows/1c047382-844d-4c85-8a7f-955c645790df]|
|[4.1|https://github.com/driftx/cassandra/tree/CASSANDRA-17818-4.1]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1053/workflows/69f8f166-3b25-46f1-943a-0d74b99481a5],
[j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1053/workflows/1dc790c6-9034-4c25-911c-07310823e1f6]|
|[trunk|https://github.com/driftx/cassandra/tree/CASSANDRA-17818-trunk]|[j8|https://app.circleci.com/pipelines/github/driftx/cassandra/1052/workflows/90acd76a-9fb4-470a-af0f-3f748fe28e5a],
[j11|https://app.circleci.com/pipelines/github/driftx/cassandra/1052/workflows/def3ea71-d9b1-4a0c-aebe-351742cb5bd1]|
> Fix error message handling when trying to use CLUSTERING ORDER with
> non-clustering column
> -----------------------------------------------------------------------------------------
>
> Key: CASSANDRA-17818
> URL: https://issues.apache.org/jira/browse/CASSANDRA-17818
> Project: Cassandra
> Issue Type: Bug
> Components: CQL/Syntax
> Reporter: Ekaterina Dimitrova
> Assignee: Ningzi Zhan
> Priority: Normal
> Labels: lhf
> Fix For: 3.11.x, 4.0.x, 4.1.x, 5.x
>
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Imagine ck1, ck2, v columns. For "CLUSTERING ORDER ck1 ASC, v DESC" error msg
> will suggest that information for ck2 is missing. But if you add it it will
> still be wrong as "v" cannot be used. So the problem here is really about
> using non-clustering column rather than about not providing information about
> some clustering column.
> The following is example from 3.11, but the code is the same in 4.0, 4.1,
> trunk:
> {code:java}
> cqlsh:k_test> CREATE TABLE test2 (pk int, ck1 int, ck2 int, v int, PRIMARY
> KEY ((pk),ck1, ck2)) WITH CLUSTERING ORDER BY (v ASC);
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Missing
> CLUSTERING ORDER for column ck1"
> cqlsh:k_test> CREATE TABLE test2 (pk int, ck1 int, ck2 int, v int, PRIMARY
> KEY ((pk),ck1, ck2)) WITH CLUSTERING ORDER BY (ck1 ASC, v ASC);
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Missing
> CLUSTERING ORDER for column ck2"
> cqlsh:k_test> CREATE TABLE test2 (pk int, ck1 int, ck2 int, v int, PRIMARY
> KEY ((pk),ck1, ck2)) WITH CLUSTERING ORDER BY (ck1 ASC, ck2 DESC, v ASC);
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Only
> clustering key columns can be defined in CLUSTERING ORDER directive"{code}
> We need to be sure that we return to the user the same correct error message
> in all three cases and it should be "Only clustering key columns can be
> defined in CLUSTERING ORDER directive"
> +Additional information for newcomers+
> *
> [This|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/cql3/statements/schema/CreateTableStatement.java#L251-L252]
> is where we handle the issue incorrectly as proved by the example. The
> easiest way to handle this issue would be to check the key set content of
> {_}clusteringOrder{_}.
> * It would be good also to add more unit tests in
> [CreateTableValidationTest|https://github.com/apache/cassandra/blob/trunk/test/unit/org/apache/cassandra/schema/CreateTableValidationTest.java]
> to cover different cases.
> * I suggest we create patch first for 3.11 and then we can propagate it up
> to the next versions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]