Re: CQL query issue

2013-03-05 Thread Vivek Mishra
Thank you  i am able to solve this one.
If i am trying as :

SELECT * FROM CompositeUser WHERE userId='mevivs' LIMIT 100 ALLOW
FILTERING

it works. Somehow got confused by
http://www.datastax.com/docs/1.2/cql_cli/cql/SELECT, which states as :

SELECT select_expression
  FROM *keyspace_name.*table_name
  *WHERE clause AND clause ...*
*ALLOW FILTERING**LIMIT n*
  *ORDER BY compound_key_2 ASC | DESC*

*
*

*is this an issue?*

*
*

*-Vivek*



On Tue, Mar 5, 2013 at 5:21 PM, Vivek Mishra mishra.v...@gmail.com wrote:

 Hi,
 I am trying to execute a cql3 query as :

 SELECT * FROM CompositeUser WHERE userId='mevivs' ALLOW FILTERING
 LIMIT 100

 and getting given below error:

 Caused by: InvalidRequestException(why:line 1:70 missing EOF at 'LIMIT')
 at
 org.apache.cassandra.thrift.Cassandra$execute_cql3_query_result.read(Cassandra.java:37849)
  at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
 at
 org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql3_query(Cassandra.java:1562)
  at
 org.apache.cassandra.thrift.Cassandra$Client.execute_cql3_query(Cassandra.java:1547)


 Is there something incorrect in syntax?



Re: CQL query issue

2013-03-05 Thread Vivek Mishra
Somebody in group, please confirm if it is an issue or that needs rectified
for select syntax.

-Vivek

On Tue, Mar 5, 2013 at 5:31 PM, Vivek Mishra mishra.v...@gmail.com wrote:

 Thank you  i am able to solve this one.
 If i am trying as :

 SELECT * FROM CompositeUser WHERE userId='mevivs' LIMIT 100 ALLOW
 FILTERING

 it works. Somehow got confused by
 http://www.datastax.com/docs/1.2/cql_cli/cql/SELECT, which states as :

 SELECT select_expression
   FROM *keyspace_name.*table_name
   *WHERE clause AND clause ...*
 *ALLOW FILTERING**LIMIT n*
   *ORDER BY compound_key_2 ASC | DESC*

 *
 *

 *is this an issue?*

 *
 *

 *-Vivek*



 On Tue, Mar 5, 2013 at 5:21 PM, Vivek Mishra mishra.v...@gmail.comwrote:

 Hi,
 I am trying to execute a cql3 query as :

 SELECT * FROM CompositeUser WHERE userId='mevivs' ALLOW FILTERING
 LIMIT 100

 and getting given below error:

 Caused by: InvalidRequestException(why:line 1:70 missing EOF at 'LIMIT')
 at
 org.apache.cassandra.thrift.Cassandra$execute_cql3_query_result.read(Cassandra.java:37849)
  at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
 at
 org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql3_query(Cassandra.java:1562)
  at
 org.apache.cassandra.thrift.Cassandra$Client.execute_cql3_query(Cassandra.java:1547)


 Is there something incorrect in syntax?





Re: CQL query issue

2013-03-05 Thread Sylvain Lebresne
This is not an issue of Cassandra. In particular
http://cassandra.apache.org/doc/cql3/CQL.html#selectStmt is up to date.
It is an issue of the datastax documentation however. I'll see with them
that this gets resolved.


On Tue, Mar 5, 2013 at 3:26 PM, Vivek Mishra mishra.v...@gmail.com wrote:

 Somebody in group, please confirm if it is an issue or that needs
 rectified for select syntax.

 -Vivek


 On Tue, Mar 5, 2013 at 5:31 PM, Vivek Mishra mishra.v...@gmail.comwrote:

 Thank you  i am able to solve this one.
 If i am trying as :

 SELECT * FROM CompositeUser WHERE userId='mevivs' LIMIT 100 ALLOW
 FILTERING

 it works. Somehow got confused by
 http://www.datastax.com/docs/1.2/cql_cli/cql/SELECT, which states as :

 SELECT select_expression
   FROM *keyspace_name.*table_name
   *WHERE clause AND clause ...*
 *ALLOW FILTERING**LIMIT n*
   *ORDER BY compound_key_2 ASC | DESC*

 *
 *

 *is this an issue?*

 *
 *

 *-Vivek*



 On Tue, Mar 5, 2013 at 5:21 PM, Vivek Mishra mishra.v...@gmail.comwrote:

 Hi,
 I am trying to execute a cql3 query as :

 SELECT * FROM CompositeUser WHERE userId='mevivs' ALLOW FILTERING
 LIMIT 100

 and getting given below error:

 Caused by: InvalidRequestException(why:line 1:70 missing EOF at 'LIMIT')
 at
 org.apache.cassandra.thrift.Cassandra$execute_cql3_query_result.read(Cassandra.java:37849)
  at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
 at
 org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql3_query(Cassandra.java:1562)
  at
 org.apache.cassandra.thrift.Cassandra$Client.execute_cql3_query(Cassandra.java:1547)


 Is there something incorrect in syntax?






Re: CQL query issue when fetching data from Cassandra

2012-02-16 Thread R. Verlangen
I'm not sure about your first 2 questions. The third might be an exception:
check your Cassandra logs.

About the like-thing: there's no such query possibiliy in Cassandra / CQL.

You can take a look at Hadoop / Hive to tackle those problems.

2012/2/16 Roshan codeva...@gmail.com

 Hi

 I am using Cassandra 1.0.6 version and having one column family in my
 keyspace.

 create column family TestCF
with comparator = UTF8Type
and column_metadata = [
{column_name : userid,
validation_class : BytesType,
index_name : userid_idx,
index_type : KEYS},
{column_name : workspace,
validation_class : BytesType,
index_name : wp_idx,
index_type : KEYS},
{column_name : module,
validation_class : BytesType,
index_name : module_idx,
index_type : KEYS},
{column_name : action,
validation_class : BytesType,
index_name : action_idx,
index_type : KEYS},
{column_name : description,
validation_class : BytesType},
{column_name : status,
validation_class : BytesType,
index_name : status_idx,
index_type : KEYS},
{column_name : createdtime,
validation_class : BytesType},
{column_name : created,
validation_class : BytesType,
index_name : created_idx,
index_type : KEYS},
{column_name : logdetail,
validation_class : BytesType}]
and keys_cached = 1
and rows_cached = 1000
and row_cache_save_period = 0
and key_cache_save_period = 3600
and memtable_throughput = 255
and memtable_operations = 0.29;

 1). The IN operator is not working
 SELECT * FROM TestCF WHERE status IN ('Failed', 'Success')
 2) The OR operator is not fetching data.
SELECT * FROM TestCF WHERE status='Failed' OR status='Success'
 3) If I use AND operator, it also not sending data. Query doesn't have
 issues, but result set is null.
SELECT * FROM TestCF WHERE status='Failed' AND status='Success'
 4) Is there any thing similar to LIKE in CQL? I want to search data based
 on some part of string.

 Could someone please help me to solve the above issues? Thanks.



 --
 View this message in context:
 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-query-issue-when-fetching-data-from-Cassandra-tp7290072p7290072.html
 Sent from the cassandra-u...@incubator.apache.org mailing list archive at
 Nabble.com.



Re: CQL query issue when fetching data from Cassandra

2012-02-16 Thread aaron morton
 1). The IN operator is not working
 SELECT * FROM TestCF WHERE status IN ('Failed', 'Success')
IN is only valid for filtering on the row KEY
http://www.datastax.com/docs/1.0/references/cql/SELECT

e.g. it generates this error using cqlsh
cqlsh:dev SELECT * FROM TestCF WHERE status IN ('Failed', 'Success');
Bad Request: Expected key 'KEY' to be present in WHERE clause for 'TestCF'

 2) The OR operator is not fetching data.
SELECT * FROM TestCF WHERE status='Failed' OR status='Success'
Not a valid statement 
cqlsh:dev SELECT * FROM TestCF WHERE status='Failed' OR status='Success';
Bad Request: line 1:45 mismatched input 'OR' expecting EOF

 3) If I use AND operator, it also not sending data. Query doesn't have
 issues, but result set is null.
SELECT * FROM TestCF WHERE status='Failed' AND status='Success'

cqlsh:dev SELECT * FROM TestCF WHERE status='Failed' AND status='Success';
Bad Request: cannot parse 'Failed' as hex bytes

Because the CF definition says the status column should contain bytes not 
ascii. 

These restrictions on secondary indexes still hold
http://www.datastax.com/docs/0.7/data_model/secondary_indexes

it looks like you are implementing a relational model. You may get some value 
is trying an approach that uses less secondary CF's. 

Cheers

-
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 16/02/2012, at 6:58 PM, Roshan wrote:

 Hi
 
 I am using Cassandra 1.0.6 version and having one column family in my
 keyspace.
 
 create column family TestCF
with comparator = UTF8Type
and column_metadata = [
   {column_name : userid,
validation_class : BytesType,
index_name : userid_idx,
index_type : KEYS},
   {column_name : workspace,
validation_class : BytesType,
index_name : wp_idx,
index_type : KEYS},
   {column_name : module,
validation_class : BytesType,
index_name : module_idx,
index_type : KEYS},
   {column_name : action,
validation_class : BytesType,
index_name : action_idx,
index_type : KEYS},
   {column_name : description,
validation_class : BytesType},
   {column_name : status,
validation_class : BytesType,
index_name : status_idx,
index_type : KEYS},
   {column_name : createdtime,
validation_class : BytesType},
   {column_name : created,
validation_class : BytesType,
index_name : created_idx,
index_type : KEYS},
   {column_name : logdetail,
validation_class : BytesType}]
and keys_cached = 1
and rows_cached = 1000
and row_cache_save_period = 0
and key_cache_save_period = 3600
and memtable_throughput = 255
and memtable_operations = 0.29;
 
 1). The IN operator is not working
 SELECT * FROM TestCF WHERE status IN ('Failed', 'Success')
 2) The OR operator is not fetching data.
SELECT * FROM TestCF WHERE status='Failed' OR status='Success'
 3) If I use AND operator, it also not sending data. Query doesn't have
 issues, but result set is null.
SELECT * FROM TestCF WHERE status='Failed' AND status='Success'
 4) Is there any thing similar to LIKE in CQL? I want to search data based
 on some part of string.
 
 Could someone please help me to solve the above issues? Thanks.
 
 
 
 --
 View this message in context: 
 http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-query-issue-when-fetching-data-from-Cassandra-tp7290072p7290072.html
 Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
 Nabble.com.



CQL query issue when fetching data from Cassandra

2012-02-15 Thread Roshan
Hi

I am using Cassandra 1.0.6 version and having one column family in my
keyspace.

create column family TestCF
with comparator = UTF8Type
and column_metadata = [
{column_name : userid,
validation_class : BytesType,
index_name : userid_idx,
index_type : KEYS},
{column_name : workspace,
validation_class : BytesType,
index_name : wp_idx,
index_type : KEYS},
{column_name : module,
validation_class : BytesType,
index_name : module_idx,
index_type : KEYS},
{column_name : action,
validation_class : BytesType,
index_name : action_idx,
index_type : KEYS},
{column_name : description,
validation_class : BytesType},
{column_name : status,
validation_class : BytesType,
index_name : status_idx,
index_type : KEYS},
{column_name : createdtime,
validation_class : BytesType},
{column_name : created,
validation_class : BytesType,
index_name : created_idx,
index_type : KEYS},
{column_name : logdetail,
validation_class : BytesType}]
and keys_cached = 1
and rows_cached = 1000
and row_cache_save_period = 0
and key_cache_save_period = 3600
and memtable_throughput = 255
and memtable_operations = 0.29;

1). The IN operator is not working
 SELECT * FROM TestCF WHERE status IN ('Failed', 'Success')
2) The OR operator is not fetching data.
SELECT * FROM TestCF WHERE status='Failed' OR status='Success'
3) If I use AND operator, it also not sending data. Query doesn't have
issues, but result set is null.
SELECT * FROM TestCF WHERE status='Failed' AND status='Success'
4) Is there any thing similar to LIKE in CQL? I want to search data based
on some part of string.

Could someone please help me to solve the above issues? Thanks.



--
View this message in context: 
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/CQL-query-issue-when-fetching-data-from-Cassandra-tp7290072p7290072.html
Sent from the cassandra-u...@incubator.apache.org mailing list archive at 
Nabble.com.