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) <raoyix...@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.[image: Company_logo] > > > > > > > > > Email: raoyix...@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
<<image001.jpg>>