question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support TOKEN function for partition keys. At least basic operators(=,<,>)

See original GitHub issue

@doanduyhai hi! appreciate your work

Can’t find how can i use Cassandra native TOKEN function for partition keys(and maybe for clustering too). For example i need to build select statement like this(https://docs.datastax.com/en/cql/3.1/cql/cql_using/paging_c.html):

SELECT * FROM customers WHERE TOKEN(id) > TOKEN(a98d0f15-aad2-4a50-94b6-8aa4e2ede079);

But i see only 3 available options in DSL:

customerManager.dsl().select().allColumns_FromBaseTable().where().id().Eq()
customerManager.dsl().select().allColumns_FromBaseTable().where().id().Eq_FromJson()
customerManager.dsl().select().allColumns_FromBaseTable().where().id().IN()

We have 2 options here:

  1. Add Token call as different Relation:
customerManager.dsl().select().allColumns_FromBaseTable().where().idToken().Eq()
customerManager.dsl().select().allColumns_FromBaseTable().where().idToken().Gt()
...
  1. Add “token” method to “id” relation:
customerManager.dsl().select().allColumns_FromBaseTable().where().id().token().Eq()
customerManager.dsl().select().allColumns_FromBaseTable().where().id().token().Gt()
...

@doanduyhai can you point me out to class where i can implement it? Is it SelectWhereDSLCodeGen class? And what is the best option to do it?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
doanduyhaicommented, Aug 19, 2017

So I need to add support for GROUP BY clause recently available in latest Cassandra version and after that we’re good for another release

There is also a project to write a comprehensive contributor guide that explains all the internal architecture of Achilles so that makes life easier for external contributors.

1reaction
vrudikovcommented, Feb 9, 2017

So here is my first attempt. Need to finish a lot from your guide above. But i’m on the right way

Here is my entity:

@Table(table = "simple_entity")
public class SimpleEntity {

    @PartitionKey
    private Long id;

    @PartitionKey(2)
    private String second;
}

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetPartitions - AWS Glue
Retrieves information about the partitions in a table.
Read more >
A deep look at the CQL WHERE clause - DataStax
The partition key columns support only two operators: = and IN ... operator on the partition key through the use of the token...
Read more >
Subject Mapping and Partitioning - NATS Docs
Deterministic token partitioning allows you to use subject based addressing to deterministically divide (partition) a flow of messages where one ...
Read more >
Data Manipulation | ScyllaDB Docs
When specifying relations, the TOKEN function can be used on the PARTITION KEY column to query. In that case, rows will be selected...
Read more >
SQL query metrics for Azure Cosmos DB for NoSQL
When a partition reaches its storage size, the service seamlessly splits the partition into two new partitions, and divides the partition key ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found