-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support LIKE queries for Cassandra with SASI #33
Comments
An issue tracker is not the place to ask a QUESTION, that is for a support forum. |
SASI indexes are calculated and stored as part of each SSTable file, differing from the original Cassandra implementation, which stores indexes in separate, “hidden” tables.
SASI indexes do offer functionality beyond the traditional secondary index implementation, such as the ability to do inequality (greater than or less than) searches on indexed columns. You can also use the new CQL LIKE keyword to do text searches against indexed columns. For example, you could use the following query to find users whose last name begins with “N”: Normally if I create the index I can query with a LIKE clause with CQL JPA Native Queries (http://www.datanucleus.org/products/accessplatform_4_2/jpa/native_query.html).
Thanks |
As already said, if you want support for such a feature then you need to implement it. |
Okay, but I have to understand before implementing what's missing. |
My project (linkedin/ambry#555 (comment)): use S3Proxy (https://github.com/gaul/s3proxy/wiki/Using-S3Proxy-in-Java-projects) with jclouds-jdbc (https://github.com/jclouds/jclouds-labs/tree/master/jdbc) and ambry-linkedin (https://github.com/linkedin). For jclouds-jdbc I want to use DataNucleus JPA with Cassandra.
I do not know the internal architecture of DataNeuclus for Cassandra. Thanks |
All code has comments, so delve into it. JPQLQuery controls the basic conversion of JPQL into CQL. QueryToCQLMapper does the conversion. Any query has a "generic" compilation, shown in the log. QueryToCQLMapper converts that into a "datastore" compilation (aka CQL). That's all there is to know. Look at the generic compilation that your query is compiled to (for the LIKE clause) and then find the equivalent place in the QueryToCQLMapper (or superclass stub) that handles that type, and implement it. |
Thank you.
Sorry but I'm stuck on that too. |
JPA already has |
Thank you. There I have all the information. I will submit a PR as soon as it is ready. |
No testcase demonstrating anything, and no pull request so closing. |
Hi,
Since Cassandra 3.4, LIKE queries can be achieved using a SSTable Attached Secondary Index (SASI).
JPQL supports the SQL LIKE operator to provide a limited form of string pattern matching.
Is this feature supported with SASI?
Thanks
Y. HILEM
The text was updated successfully, but these errors were encountered: