Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 073A5200CBA for ; Mon, 3 Jul 2017 23:17:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 05C9B160BEC; Mon, 3 Jul 2017 21:17:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4B4E1160BD2 for ; Mon, 3 Jul 2017 23:17:03 +0200 (CEST) Received: (qmail 2765 invoked by uid 500); 3 Jul 2017 21:17:01 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 2755 invoked by uid 99); 3 Jul 2017 21:17:01 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Jul 2017 21:17:01 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 45C2FC0157 for ; Mon, 3 Jul 2017 21:17:01 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id LgV3mGfK8i7K for ; Mon, 3 Jul 2017 21:17:00 +0000 (UTC) Received: from mail-vk0-f52.google.com (mail-vk0-f52.google.com [209.85.213.52]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 45F525F576 for ; Mon, 3 Jul 2017 21:17:00 +0000 (UTC) Received: by mail-vk0-f52.google.com with SMTP id r126so102036582vkg.0 for ; Mon, 03 Jul 2017 14:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=umZQAPWOqYyf9ls3x3FtEfnMPkxIxMkRNqelbbI3+dg=; b=LdjlbYjhAdRnSMvxTCSTzhDZdgJWSc7hiKEQQH8y7euZDHqrnGWbaYUnELp4ICUIpG dpz9nRcKDNdX8hwG4qzzjWmQnM5hXVr8Zt9ETi3SBBtMGD678lbmxhk7kHpFFyd2/hId 0JatfDxTTDO2ffzKNwIRrQ5eSHGF1mrgsUYdKoXnamqd37XxVx90lqeLd0MSu6V6o/9a 03BAYGQd2TlM4n2w5mXFTcYK0hgNaUbGkusHaOhEqxZAhcZ2s0W83BBdBzRC4Nt1BMRf hvxp/bvZRd9xB6L0XivqChsFpz0uDmWHk21q1oeSxd1jrBqsa8NGg6Y7GHg0PgUjgVT5 yXwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=umZQAPWOqYyf9ls3x3FtEfnMPkxIxMkRNqelbbI3+dg=; b=uNOaVca9l/AihzXO7sijoKYAaCBO4WaYkgAAR6+jbmkrdL2qvx3Els4VB6o4Ocgjw+ vfaDDjd4QBFYhOSaYNmOIRF2VG0iEqY394C2PNieMaDmIwfHcH9KQ8v7GHIISAMVu025 VHgcVK2T3bbRLNefPL+7Fy4K0pS4EGODsCqwT2M2hrxlV3Cx7kDwIE5EZanHS6WV/h5H SegNbqsONzNj5BHuAXvfVe3Tqtgq+Zt3CEr3WL3pZ5RIgaVOm9jPboCWnml3JHoRQ4lc 3iS8X/DK52TIs8rS1m3VqiayIw/ickiHXWe+7eCCRNFfBCfStkLFLIXRRh1RTvxqY6uI lcAw== X-Gm-Message-State: AKS2vOwkXPhm7UF5esWOgM6Bg9BRPNw33eh9Jgk82HTzgWNWIftsJYZM z7PbKoDJL91HnxfDN+ycTP9E7MJ5lg== X-Received: by 10.31.114.75 with SMTP id n72mr20038577vkc.24.1499116614288; Mon, 03 Jul 2017 14:16:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.81.82 with HTTP; Mon, 3 Jul 2017 14:16:33 -0700 (PDT) In-Reply-To: References: From: DuyHai Doan Date: Mon, 3 Jul 2017 23:16:33 +0200 Message-ID: Subject: Re: UDF for sorting To: user Content-Type: multipart/alternative; boundary="94eb2c14949a458add055370497e" archived-at: Mon, 03 Jul 2017 21:17:04 -0000 --94eb2c14949a458add055370497e Content-Type: text/plain; charset="UTF-8" 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 . 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 where pk1=123 and cc1=345;* > > and > *select * from 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 > --94eb2c14949a458add055370497e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Plain answer is no you can't

The re= ason 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=C2= =A0

CREATE TABLE ks.cf ( pk1 bigint, cc1 bigint, disp_name text , stat_obj t= ext, 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= =C2=A0
select * from ks.cf= where pk1=3D123 and cc1=3D345;

and=C2=A0<= br>select * from ks.cf wh= ere pk1=3D123 and status=3D1;
In this case , I want rows to b= e 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=C2=A0

--94eb2c14949a458add055370497e--