incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raoyixuan (Shandy)" <raoyix...@huawei.com>
Subject RE: indexedslicesQuery class error
Date Thu, 17 Feb 2011 02:44:27 GMT
Not really.

I also tried the code as below:
StringSerializer ss = StringSerializer.get();
LongSerializer ls = LongSerializer.get();
IndexedSlicesQuery<String, String, Long> indexedSlicesQuery = HFactory.createIndexedSlicesQuery(keyspace,
ss, ss, ls);
indexedSlicesQuery.setColumnNames("full_name", "birth_date", "state");
indexedSlicesQuery.addGtExpression("birth_date", 1970L);
indexedSlicesQuery.addEqualsExpression("state", "UT");
indexedSlicesQuery.setColumnFamily("users");
indexedSlicesQuery.setStartKey("");
QueryResult<OrderedRows<String, String, Long>> result = indexedSlicesQuery.execute();
It shows the error:
The method addGtEqual<Epression(String,Long) in the type IndexedSlicesQuery<String,String,Long>
is not applicable for the arguments(String,String)



From: Roshan Dawrani [mailto:roshandawrani@gmail.com]
Sent: Thursday, February 17, 2011 10:37 AM
To: user@cassandra.apache.org
Subject: Re: indexedslicesQuery class error

That's because in createIndexedSlicesQuery(), you have used SS as the valueSerializer, and
then in addGtExpression("birth_date", 1970L), you pass a long as the value.

@see: https://groups.google.com/group/hector-users/browse_thread/thread/520c5332dedfca4a

2011/2/17 Raoyixuan (Shandy) <raoyixuan@huawei.com<mailto:raoyixuan@huawei.com>>
I do the range query  by the hector client when the state and birht_date columns are both
indexed, it show the error:

The method addGtExpression(String,String) in the type IndexedSlicesQuery<String,String,String>
is not applicable for the arguments(String,long)

The code is as below:

StringSerializer ss = StringSerializer.get();
IndexedSlicesQuery<String, String, String> indexedSlicesQuery = HFactory.createIndexedSlicesQuery(keyspace,
ss, ss, ss);
indexedSlicesQuery.setColumnNames("full_name", "birth_date", "state");
indexedSlicesQuery.addGtExpression("birth_date", 1970L);
indexedSlicesQuery.addEqualsExpression("state", "UT");
indexedSlicesQuery.setColumnFamily("users");
indexedSlicesQuery.setStartKey("");
QueryResult<OrderedRows<String, String, String>> result = indexedSlicesQuery.execute();

华为技术有限公司 Huawei Technologies Co., Ltd.[Company_logo]




Email: raoyixuan@huawei.com<mailto:raoyixuan@huawei.com>
地址:深圳市龙岗区坂田华为基地 邮编:518129
Huawei Technologies Co., Ltd.
Bantian, Longgang District,Shenzhen 518129, P.R.China
http://www.huawei.com
________________________________
本邮件及其附件含有华为公司的保密信息,仅限于发送给上面地址中列出的个人或群组。禁
止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、或散发)本邮件中
的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本邮件!
This e-mail and its attachments contain confidential information from HUAWEI, which
is intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by
phone or email immediately and delete it!




--
Roshan
Blog: http://roshandawrani.wordpress.com/
Twitter: @roshandawrani<http://twitter.com/roshandawrani>
Skype: roshandawrani
Mime
View raw message