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 EE372200C8C for ; Tue, 6 Jun 2017 20:39:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id ECBEC160BC6; Tue, 6 Jun 2017 18:39:09 +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 E637C160BB7 for ; Tue, 6 Jun 2017 20:39:08 +0200 (CEST) Received: (qmail 75082 invoked by uid 500); 6 Jun 2017 18:39:07 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 75071 invoked by uid 99); 6 Jun 2017 18:39:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2017 18:39:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id E3AB5C13E1 for ; Tue, 6 Jun 2017 18:39:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.1 X-Spam-Level: ** X-Spam-Status: No, score=2.1 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, KAM_LINEPADDING=1.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id J8FnDWuSrHgk for ; Tue, 6 Jun 2017 18:39:04 +0000 (UTC) Received: from mail-vk0-f43.google.com (mail-vk0-f43.google.com [209.85.213.43]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 8A0C25FB5C for ; Tue, 6 Jun 2017 18:39:04 +0000 (UTC) Received: by mail-vk0-f43.google.com with SMTP id 191so1628223vko.2 for ; Tue, 06 Jun 2017 11:39:04 -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 :cc; bh=+OpQ5AXZmibK9SjdWpPnWd2m0Gc5lmJ+3kZI1ysYjxw=; b=PkwEPDZYP0QCIu1Djgq45kIWqpqo0zE3ZlYEmCjLU/pvgXHqgg0m6NDUf5Ob5D7WOs 0Wih44XAtouPYaCd5sBbmSwqNCDQKSw6lwZtpxy8PVkegsOcLSz6EDV1cMHVsvsxewPO o4bvv7vDqoDjuMt/4FUzRAKsu7D09cwryTKKuNLeSHtHhKD9ONxiQ21teb82CSnDNszV W6nc65G5txQs54tFsK5KHNQoJQSncp4MnCxDsUNUrEa31z1UcXbMKms74V+ciTWuHtar 77IbifNpWYF5Vob1fnlE8kR05UV3NBY5cKqy3BmKHXJ6FrhPAHKrGs9U2pZeqr40a7ov qoYQ== 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:cc; bh=+OpQ5AXZmibK9SjdWpPnWd2m0Gc5lmJ+3kZI1ysYjxw=; b=LEH6FMhEohbpWmLh6oGCTC/EHj51lCHUn6r2AQhwqYIhY3nIlXNwylWan3bmZR/Hyz nKDOcrs37lkSFNIWE47/TsJDroYtCrsocIDDf6p9qmBUi51J2ABpugbhYqg7GxSEezlX VFVbqYPy3ifePh1t18KMr2dOZrpfC5d7ykwQcIeqa94vDUWQx9c63iKkJAv1Qufg63yA N/HmL6oBqLIqKYLQ0NxuaTiWmw0LlY6vy3NrSuVG7fOCs1110nUUQoah+pyU0CKEkiRR T/yCDGfzfsMsKkbZLCBbBveA/xZ2+8iFS4zXU9OkTLH+2brZFiqRzCvgZmLhODbFup/S Bhjw== X-Gm-Message-State: AODbwcAjAlKQORfp0KhK1Cd+Ih8+P4OJarDTpLfFSCc1pgLs5I60gtg2 H5m0dgDWa46/sIKDmXVO3GwkiujgTw== X-Received: by 10.31.10.77 with SMTP id 74mr14915338vkk.118.1496774343985; Tue, 06 Jun 2017 11:39:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.148.143 with HTTP; Tue, 6 Jun 2017 11:38:43 -0700 (PDT) In-Reply-To: References: <35006c8af9124174b0a9b9eee536e6b8@HQ1WP-EXMB12.corp.brocade.com> From: DuyHai Doan Date: Tue, 6 Jun 2017 20:38:43 +0200 Message-ID: Subject: Re: Order by for aggregated values To: "Roger Fischer (CW)" Cc: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary="001a1145a5b61516b305514eef13" archived-at: Tue, 06 Jun 2017 18:39:10 -0000 --001a1145a5b61516b305514eef13 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The problem is not that it's not feasible from Cassandra side, it is The problem is when doing arbitrary ORDER BY, Cassandra needs to resort to in-memory sorting of a potentially huge amout of data --> more pressure on heap --> impact on cluster stability Whereas delegating this kind of job to Spark which has appropriate data structure to lower heap pressure (Dataframe, project tungsten) is a better idea. "but in the Top N use case, far more data has to be transferred to the client when the client has to do the sorting" --> It is not true if you co-located your Spark worker with Cassandra nodes. In this case, Spark reading data out of Cassandra nodes are always node-local On Tue, Jun 6, 2017 at 6:20 PM, Roger Fischer (CW) wrote: > Hi DuyHai, > > > > this is in response to the other points in your response. > > > > My application is a real-time application. It monitors devices in the > network and displays the top N devices for various parameters averaged ov= er > a time period. A query may involve anywhere from 10 to 50k devices, and > anywhere from 5 to 2000 intervals. We expect a query to take less than 2 > seconds. > > > > My impression was that Spark is aimed at larger scale analytics. > > > > I am ok with the limitation on =E2=80=9Cgroup by=E2=80=9D. I am intending= to use async > queries and token-aware load balancing to partition the query and execute > it in parallel on each node. > > > > Thanks=E2=80=A6 > > > > Roger > > > > > > *From:* DuyHai Doan [mailto:doanduyhai@gmail.com] > *Sent:* Tuesday, June 06, 2017 12:31 AM > *To:* Roger Fischer (CW) > *Cc:* user@cassandra.apache.org > *Subject:* Re: Order by for aggregated values > > > > First Group By is only allowed on partition keys and clustering columns, > not on arbitrary column. The internal implementation of group by tries to > fetch data on clustering order to avoid having to "re-sort" them in memor= y > which would be very expensive > > > > Second, group by works best when restricted to a single partition other > wise it will force Cassandra to do a range scan so poor performance > > > > > > For all of those reasons I don't expect an "order by" on aggregated value= s > to be available any soon > > > > Furthermore, Cassandra is optimised for real-time transactional scenarios= , > the group by/order by/limit is typically a classical analytics scenario, = I > would recommend to use the appropriate tool like Spark for that > > > > > > Le 6 juin 2017 04:00, "Roger Fischer (CW)" a =C3=A9= crit : > > Hello, > > > > is there any intent to support =E2=80=9Corder by=E2=80=9D and =E2=80=9Cli= mit=E2=80=9D on aggregated values? > > > > For time series data, top n queries are quite common. Group-by was the > first step towards supporting such queries, but ordering by value and > limiting the results are also required. > > > > Thanks=E2=80=A6 > > > > Roger > > > > > > > > > --001a1145a5b61516b305514eef13 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The problem is not that it's not feasible from Cassand= ra side, it is=C2=A0

The problem is when doing arbitrary= ORDER BY, Cassandra needs to resort to in-memory sorting of a potentially = huge amout of data --> more pressure on heap --> impact on cluster st= ability

Whereas delegating this kind of job to Spa= rk which has appropriate data structure to lower heap pressure (Dataframe, = project tungsten) is a better idea.

"but in the Top N use case, far more data has to be transferred to the = client when the client has to do the sorting"

--> It is not true if you co-lo= cated your Spark worker with Cassandra nodes. In this case, Spark reading d= ata out of Cassandra nodes are always node-local



On Tue, Jun 6, 2017 at 6:20 PM= , Roger Fischer (CW) <rfische@brocade.com> wrote:

Hi DuyHai,

=C2=A0

this is in response to the other poin= ts in your response.

=C2=A0

My application is a real-time applica= tion. It monitors devices in the network and displays the top N devices for= various parameters averaged over a time period. A query may involve anywhere from 10 to 50k devices, and anywhere from 5 t= o 2000 intervals. We expect a query to take less than 2 seconds.<= /u>

=C2=A0

My impression was that Spark is aimed= at larger scale analytics.

=C2=A0

I am ok with the limitation on =E2=80= =9Cgroup by=E2=80=9D. I am intending to use async queries and token-aware l= oad balancing to partition the query and execute it in parallel on each node.

=C2=A0

Thanks=E2=80=A6<= /p>

=C2=A0

Roger

=C2=A0

=C2=A0

From: DuyHai Doan [mailto:doanduyhai@gmail.com]
Sent: Tuesday, June 06, 2017 12:31 AM
To: Roger Fischer (CW) <rfische@Brocade.com>
Cc: u= ser@cassandra.apache.org
Subject: Re: Order by for aggregated values

=C2=A0

First Group By is only allowed on partition keys and= clustering columns, not on arbitrary column. The internal implementation o= f group by tries to fetch data on clustering order to avoid having to "= ;re-sort" them in memory which would be very expensive=C2=A0

=C2=A0

Second, group by works best when restricted to a sin= gle partition other wise it will force Cassandra to do a range scan so poor= performance=C2=A0

=C2=A0

=C2=A0

For all of those reasons I don't expect an "= ;order by" on aggregated values to be available any soon=

=C2=A0

Furthermore, Cassandra is optimised for real-time tr= ansactional scenarios, the group by/order by/limit is typically a classical= analytics scenario, I would recommend to use the appropriate tool like Spa= rk for that=C2=A0

=C2=A0

=C2=A0

Le=C2=A06 juin 2017 04:00, "Roger Fischer (CW)&= quot; <rfische@= brocade.com> a =C3=A9crit=C2=A0:

Hello,

=C2=A0

is there any intent to support =E2=80=9Corder by=E2= =80=9D and =E2=80=9Climit=E2=80=9D on aggregated values?

=C2=A0

For time series data, top n queries are quite common= . Group-by was the first step towards supporting such queries, but ordering= by value and limiting the results are also required.

=C2=A0

Thanks=E2=80=A6

=C2=A0

Roger

=C2=A0

=C2=A0

=C2=A0

=C2=A0


--001a1145a5b61516b305514eef13--