[jira] [Commented] (CASSANDRA-7637) Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)

2014-09-29 Thread Sunil Kumar Singh (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14151407#comment-14151407
 ] 

Sunil Kumar Singh commented on CASSANDRA-7637:
--

I have started to looking into this Issue once understand  I will mark it as 
In Progress. If any more suggestion on requirement, Please make it clear.  

 Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)
 --

 Key: CASSANDRA-7637
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7637
 Project: Cassandra
  Issue Type: New Feature
  Components: API
Reporter: Rustam Aliyev
Assignee: Sunil Kumar Singh
 Fix For: 3.0


 Currently, if I want to perform range query on lexical type I need to do 
 something like this:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute  'interests.food.' AND
   attribute  'interests.food.z';
 {code}
 This is very efficient range query. Yet, many users who are not familiar with 
 Thrift and storage level implementation are unaware of this trick.
 Therefore, it would be convenient to introduce CQL keyword which will do this 
 more simply:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute START_WITH('interests.food.');
 {code}
 Keyword would have same restrictions as other inequality search operators 
 plus some type restrictions.
 Allowed types would be:
  * {{ascii}}
  * {{text}} / {{varchar}}
  * {{maptext, *}} (same for ascii) (?)
  * {{settext}} (same for ascii) (?)
 (?) may require more work, therefore optional



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


[jira] [Commented] (CASSANDRA-7637) Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)

2014-07-30 Thread Rustam Aliyev (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14079105#comment-14079105
 ] 

Rustam Aliyev commented on CASSANDRA-7637:
--

There's already so many places where inequality and equality operators just 
return Bad Request. From user experience point of view, it's not very 
different. Error message/docs can refine usage.

Good thing about LIKE keyword is that it can be extended to other use cases in 
future (e.g. ALLOW FILTERING).

 Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)
 --

 Key: CASSANDRA-7637
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7637
 Project: Cassandra
  Issue Type: New Feature
  Components: API
Reporter: Rustam Aliyev
 Fix For: 3.0


 Currently, if I want to perform range query on lexical type I need to do 
 something like this:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute  'interests.food.' AND
   attribute  'interests.food.z';
 {code}
 This is very efficient range query. Yet, many users who are not familiar with 
 Thrift and storage level implementation are unaware of this trick.
 Therefore, it would be convenient to introduce CQL keyword which will do this 
 more simply:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute START_WITH('interests.food.');
 {code}
 Keyword would have same restrictions as other inequality search operators 
 plus some type restrictions.
 Allowed types would be:
  * {{ascii}}
  * {{text}} / {{varchar}}
  * {{maptext, *}} (same for ascii) (?)
  * {{settext}} (same for ascii) (?)
 (?) may require more work, therefore optional



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7637) Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)

2014-07-30 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14079225#comment-14079225
 ] 

Jack Krupansky commented on CASSANDRA-7637:
---

bq. attribute  'interests.food.z';

That's a great argument for this improvement - the simple, obvious explicit 
range... is incorrect. It won't match 'interests.food.zebra or even 
'interests.food.z.

It would need to be something like:

{code}
SELECT * FROM profile WHERE profile_id = 123 AND
  attribute  'interests.food.' AND
  attribute  'interests.food.{';
{code}



 Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)
 --

 Key: CASSANDRA-7637
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7637
 Project: Cassandra
  Issue Type: New Feature
  Components: API
Reporter: Rustam Aliyev
 Fix For: 3.0


 Currently, if I want to perform range query on lexical type I need to do 
 something like this:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute  'interests.food.' AND
   attribute  'interests.food.z';
 {code}
 This is very efficient range query. Yet, many users who are not familiar with 
 Thrift and storage level implementation are unaware of this trick.
 Therefore, it would be convenient to introduce CQL keyword which will do this 
 more simply:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute START_WITH('interests.food.');
 {code}
 Keyword would have same restrictions as other inequality search operators 
 plus some type restrictions.
 Allowed types would be:
  * {{ascii}}
  * {{text}} / {{varchar}}
  * {{maptext, *}} (same for ascii) (?)
  * {{settext}} (same for ascii) (?)
 (?) may require more work, therefore optional



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7637) Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)

2014-07-29 Thread Jack Krupansky (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14078555#comment-14078555
 ] 

Jack Krupansky commented on CASSANDRA-7637:
---

Why not use the SQL LIKE keyword operator and just support trailing wildcard 
(AKA prefix query) for now?

{code}
SELECT * FROM profile WHERE profile_id = 123 AND
  attribute LIKE 'interests.food.*';
{code}

See:
http://www.w3schools.com/sql/sql_wildcards.asp
or
http://docs.oracle.com/cd/B12037_01/server.101/b10759/conditions016.htm



 Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)
 --

 Key: CASSANDRA-7637
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7637
 Project: Cassandra
  Issue Type: New Feature
  Components: API
Reporter: Rustam Aliyev

 Currently, if I want to perform range query on lexical type I need to do 
 something like this:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute  'interests.food.' AND
   attribute  'interests.food.z';
 {code}
 This is very efficient range query. Yet, many users who are not familiar with 
 Thrift and storage level implementation are unaware of this trick.
 Therefore, it would be convenient to introduce CQL keyword which will do this 
 more simply:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute START_WITH('interests.food.');
 {code}
 Keyword would have same restrictions as other inequality search operators 
 plus some type restrictions.
 Allowed types would be:
  * {{ascii}}
  * {{text}} / {{varchar}}
  * {{inet}} (?)
  * {{maptext, *}} (same for ascii) (?)
  * {{settext}} (same for ascii) (?)
 (?) may require more work, therefore optional



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7637) Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)

2014-07-29 Thread Rustam Aliyev (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14078599#comment-14078599
 ] 

Rustam Aliyev commented on CASSANDRA-7637:
--

Agree, LIKE would be more SQL compatible way to do it. It will be very limited 
functionality for LIKE, only {{%}} wildcard in the end of an expression. But I 
think it's still better.

I'm also removing inet type - I think there are better ways to do range queries 
on that one.

Btw, in your example above it should be {{%}} in the end.

 Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)
 --

 Key: CASSANDRA-7637
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7637
 Project: Cassandra
  Issue Type: New Feature
  Components: API
Reporter: Rustam Aliyev
 Fix For: 3.0


 Currently, if I want to perform range query on lexical type I need to do 
 something like this:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute  'interests.food.' AND
   attribute  'interests.food.z';
 {code}
 This is very efficient range query. Yet, many users who are not familiar with 
 Thrift and storage level implementation are unaware of this trick.
 Therefore, it would be convenient to introduce CQL keyword which will do this 
 more simply:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute START_WITH('interests.food.');
 {code}
 Keyword would have same restrictions as other inequality search operators 
 plus some type restrictions.
 Allowed types would be:
  * {{ascii}}
  * {{text}} / {{varchar}}
  * {{inet}} (?)
  * {{maptext, *}} (same for ascii) (?)
  * {{settext}} (same for ascii) (?)
 (?) may require more work, therefore optional



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (CASSANDRA-7637) Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)

2014-07-29 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-7637?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14078650#comment-14078650
 ] 

Brandon Williams commented on CASSANDRA-7637:
-

If we use LIKE a lot of people are going to ask why LIKE '%foo' or LIKE '%foo%' 
doesn't work.

 Add CQL3 keyword for efficient lexical range queries (e.g. START_WITH)
 --

 Key: CASSANDRA-7637
 URL: https://issues.apache.org/jira/browse/CASSANDRA-7637
 Project: Cassandra
  Issue Type: New Feature
  Components: API
Reporter: Rustam Aliyev
 Fix For: 3.0


 Currently, if I want to perform range query on lexical type I need to do 
 something like this:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute  'interests.food.' AND
   attribute  'interests.food.z';
 {code}
 This is very efficient range query. Yet, many users who are not familiar with 
 Thrift and storage level implementation are unaware of this trick.
 Therefore, it would be convenient to introduce CQL keyword which will do this 
 more simply:
 {code}
 SELECT * FROM profile WHERE profile_id = 123 AND
   attribute START_WITH('interests.food.');
 {code}
 Keyword would have same restrictions as other inequality search operators 
 plus some type restrictions.
 Allowed types would be:
  * {{ascii}}
  * {{text}} / {{varchar}}
  * {{maptext, *}} (same for ascii) (?)
  * {{settext}} (same for ascii) (?)
 (?) may require more work, therefore optional



--
This message was sent by Atlassian JIRA
(v6.2#6252)