1

As per the Forums and Few Folks experience i understood Java Driver can help as per the following post ..

Cassandra 3 Java Driver build dynamic queries1

But is there any way to build a query in Cassandra with out java driver. Unfortunately No One Answered the query here Dealing with dynamic Query String in Cassandra . Took It as Chance to Raise it again .

Thanks, Prasad

Prasad
  • 1,562
  • 5
  • 26
  • 40

1 Answers1

1

There are 2 aspects here:

  1. Easiest one - the building of the query itself - this could be done by just concatenating strings, or by using QueryBuilder as it was discussed in the first question.
  2. Most complex one - how the query is executed. In Cassandra it's required that you provided a partition key (at least) when you performing a query. Otherwise you will perform the full table scan that most probably will end with with read timeout.

To mitigate 2nd problem, people are doing denormalization and creating auxiliary tables where particular field is partition key. But this couldn't be done automatically, as you may end with very skewed data distribution for specific tables. Secondary indexes are also have limitations, and best work with partition key as well.

P.S. In DataStax Enterprise, this could be slightly relaxed by adding DSE Search index on the table, but performance would be slightly worse than pure Cassandra.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132