Re: Ordering by multiple columns?

2016-10-10 Thread Mikhail Krupitskiy
Looks like ordering by multiple columns in Cassandra has few sides that are not obvious. I wasn’t able to find this information in the official documentation but it’s quite well described here: http://stackoverflow.com/questions/35708118/where-and-order-by-clauses-in-cassandra-cql

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-10-04 Thread Mikhail Krupitskiy
ct operation type BEFORE escaping or AFTER escaping ? As I understand ‘escaping' will be done by users. So on DB level we get an already escaped string from a request and it’s possible to know which symbol is a wildcard and which is just a char. I guess that Cassandra should parse (unescap

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-26 Thread Mikhail Krupitskiy
ildcard IF AND > ONLY IF it is the first/last character of the searched term > > > LIKE '%escape' --> ENDS WITH 'escape' > > If we use % to escape %, > LIKE '%%escape' --> EQUALS TO '%escape' > > LIK

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-23 Thread Mikhail Krupitskiy
means STARTS WITH '%' AND ENDS WITH 'escape' > So the first two %'s are translated to a literal, non-wildcard % and the > third % is a wildcard because it's not doubled. > > Jim > > On Thu, Sep 22, 2016 at 11:40 AM, Mikhail Krupitskiy > mailto:mikh

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-22 Thread Mikhail Krupitskiy
;escape' > > What's about LIKE '%%%escape' > > How should we treat this case ? Replace %% by % at the beginning of the > searched term ?? > > > > On Thu, Sep 22, 2016 at 3:31 PM, Mikhail Krupitskiy > mailto:mikhail.krupits...@jetbrains.co

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-22 Thread Mikhail Krupitskiy
7;t know if converting > the bytebuffer into String at this stage of the CQL parser is expensive or > not (in term of computation) > > Let me try a patch So is there any update on this? Thanks, Mikhail > On 20 Sep 2016, at 18:38, Mikhail Krupitskiy > wrote: > >

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-20 Thread Mikhail Krupitskiy
x27; > > What I strongly suspect is that in the source code of SASI, we parse the % > xxx % expression BEFORE applying escape. That will explain the observed > behavior. E.g: > > LIKE '%%esc%' parsed as %xxx% where xxx = %esc > > LIKE 'escape%%' parsed a

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-15 Thread Mikhail Krupitskiy
d > behavior. E.g: > > LIKE '%%esc%' parsed as %xxx% where xxx = %esc > > LIKE 'escape%%' parsed as xxx% where xxx =escape% > > Let me check in the source code and try to reproduce the issue > > > > On Tue, Sep 13, 2016 at 7:24 PM, Mikhail

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-13 Thread Mikhail Krupitskiy
escape WHERE val LIKE 'escape%%' --> Give all results starting > with 'escape%' so escape%me is a valid result and also escape%esc Why ’starting’? I expect that it should be ‘exact matching’. > > On Tue, Sep 13, 2016 at 5:58 PM, Mikhail Krupitskiy > mailt

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-13 Thread Mikhail Krupitskiy
LIKE '%%esc%'; > > id | val > +--- > 1 | %escapeme > > (1 rows) > > > Prefix search > > cqlsh:test> SELECT * FROM escape WHERE val LIKE 'escape%%'; > > id | val > +--- > 2 | escape%me > > On

How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-13 Thread Mikhail Krupitskiy
Hi Cassandra guys, I use Cassandra 3.7 and wondering how to use ‘%’ as a simple char in a search pattern. Here is my test script: DROP keyspace if exists kmv; CREATE keyspace if not exists kmv WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor':'1'} ; USE kmv; CREATE TABLE if