You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benjamin Lerer (Jira)" <ji...@apache.org> on 2020/07/02 12:31:00 UTC

[jira] [Commented] (CASSANDRA-15911) Allow partition scan, querying cluster keys out of order

    [ https://issues.apache.org/jira/browse/CASSANDRA-15911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17150232#comment-17150232 ] 

Benjamin Lerer commented on CASSANDRA-15911:
--------------------------------------------

Filtering on clustering columns is supported since Cassandra 3.6 (CASSANDRA-11310). The {{SELECT}} query will work if you add {{ALLOW FILTERING}} to your query.

> Allow partition scan, querying cluster keys out of order
> --------------------------------------------------------
>
>                 Key: CASSANDRA-15911
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15911
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Tri Nguyen
>            Priority: Normal
>
>  
> On the following table
> {code:java}
> CREATE TABLE actors_by_video (
>    video_id TIMEUUID,
>    actor_name TEXT,
>    character_name TEXT,
>    PRIMARY KEY ((video_id), actor_name, character_name)
> );{code}
>  
> The query
>  
> {code:java}
> SELECT * FROM actors_by_video
> WHERE video_id = 1234abcd-1111-2222-3333-aaaabbbbcccc
> AND character_name = 'The PK Father';{code}
>  
> fails with the following error:
> {color:#de350b}InvalidRequest: Error from server: code=2200 [Invalid query] message="PRIMARY KEY column "character_name" cannot be restricted as preceding column "actor_name" is not restricted {color}
> *QUESTION:*
> Let's assume this is a query which doesn't occur frequently, so it is not worth to create a new table with the proper Primary Key. However, because the scope of the query is limited within ONE SINGLE partition key. I am willing to accept the performance penalty incurred for that "partition scan".
> Would it be possible to allow CQL to allow this query, in a similar fastion than "ALLOW FILTERING" ? But here, to denote a scan within a partition, maybe can we name it "ALLOW PARTITION FILTERING" ?
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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