cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-12770) Token() CQL Function To Be Used Without Args
Date Tue, 11 Oct 2016 07:18:21 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-12770?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sylvain Lebresne updated CASSANDRA-12770:
-----------------------------------------
    Priority: Minor  (was: Major)

> Token() CQL Function To Be Used Without Args
> --------------------------------------------
>
>                 Key: CASSANDRA-12770
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-12770
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Russell Spitzer
>            Priority: Minor
>
> The Spark Cassandra Connector uses statments like
> {code}
> SELECT ... WHERE TOKEN(partitionkey) < #
> {code}
> But I was considering today, why should we pass the partition key names to the Token
Function?
> If we look at the TokenRestriction
> https://github.com/apache/cassandra/blob/81f6c784ce967fadb6ed7f58de1328e713eaf53c/src/java/org/apache/cassandra/cql3/TokenRelation.java#L174-L184
> The restrictions on the token function basically mean there is only ever 1 valid invocation
of {{Token}}
> {code}
> Token(partitionkey1, partitionkey2, partitionkey3)
> {code}
> Now there can be an argument that this is helpful to folks matching {{Tokens}} together
> {code}
> Token(partitionkey1, partitionkey2, partitionkey3) < Token(1,1,3)
> {code}
> But if we have a single literal on the right hand side
> {code}
> Token(partitionkey1, partitionkey2, partitionkey3) < 10
> {code}
> The invocation just seems to have a lot of extra syntax but no benefit.
> It would be great if it looked like this instead
> {code}
> Token() > 0 OR Token() < 30000
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message