cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Cameron <jus...@instaclustr.com>
Subject Re: UDF for sorting
Date Mon, 03 Jul 2017 23:19:05 GMT
While you can't do this with Cassandra, you can get the functionality you
want with the cassandra-lucene-plugin (
https://github.com/Stratio/cassandra-lucene-index/blob/branch-3.0.10/doc/documentation.rst#searching
).

Keep in mind that as with any secondary index there are performance-related
limitations:
https://github.com/Stratio/cassandra-lucene-index/blob/branch-3.0.10/doc/documentation.rst#performance-tips


On Tue, 4 Jul 2017 at 07:17 DuyHai Doan <doanduyhai@gmail.com> wrote:

> Plain answer is no you can't
>
> The reason is that UDF only transform column values on each row but does
> not have the ability to modify rows ordering
>
> On Mon, Jul 3, 2017 at 10:14 PM, techpyaasa . <techpyaasa@gmail.com>
> wrote:
>
>> Hi all,
>>
>> I have a table like
>>
>> CREATE TABLE ks.cf ( pk1 bigint, cc1 bigint, disp_name text , stat_obj
>> text, status int, PRIMARY KEY (pk1, cc1)) WITH CLUSTERING ORDER BY (cc1 ASC)
>>
>> CREATE INDEX idx1 on ks.cf(status);
>>
>> I want to have a queries like
>> *select * from ks.cf <http://ks.cf> where pk1=123 and cc1=345;*
>>
>> and
>> *select * from ks.cf <http://ks.cf> where pk1=123 and status=1;*
>> In this case , I want rows to be sorted based on 'disp_name' (asc/desc) .
>>
>> Can I achieve the same using UDF or anything else ?? (Sorry If my
>> understanding about UDF is wrong).
>>
>> Thanks in advance
>> TechPyaasa
>>
>
> --


*Justin Cameron*Senior Software Engineer


<https://www.instaclustr.com/>


This email has been sent on behalf of Instaclustr Pty. Limited (Australia)
and Instaclustr Inc (USA).

This email and any attachments may contain confidential and legally
privileged information.  If you are not the intended recipient, do not copy
or disclose its content, but please reply to this email immediately and
highlight the error to the sender and then immediately delete the message.

Mime
View raw message