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 DFA02200C7E for ; Tue, 9 May 2017 05:07:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id DCB53160BBF; Tue, 9 May 2017 03:07:41 +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 2EC66160BA5 for ; Tue, 9 May 2017 05:07:41 +0200 (CEST) Received: (qmail 56660 invoked by uid 500); 9 May 2017 03:07:39 -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 56649 invoked by uid 99); 9 May 2017 03:07:39 -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; Tue, 09 May 2017 03:07:39 +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 B3CE6C01DB for ; Tue, 9 May 2017 03:07:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.979 X-Spam-Level: * X-Spam-Status: No, score=1.979 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=instaclustr-com.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id b2r53OABCoCt for ; Tue, 9 May 2017 03:07:35 +0000 (UTC) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com [209.85.161.181]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DEC4C5F1B3 for ; Tue, 9 May 2017 03:07:34 +0000 (UTC) Received: by mail-yw0-f181.google.com with SMTP id l135so38522550ywb.2 for ; Mon, 08 May 2017 20:07:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=instaclustr-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=erbV+L4TRYoVXS/pRZYHZrdS+5aC4zTLnh7N20zZh3k=; b=OFU0l8Dx4QGoYDxiN/c0CRLAHg8yWYOs+IDzuZupaGV74Kgc9uFyiDcmfQybEmFK88 /M6fG3C6vWqjrTLAybS1w5T6yH2aVFnP/jUAfj27BQLCvudAuDTW8FHiGJqICOrZp7Yy yrKGTSyKgGHyiEdG8oojFVi0cT1fhVSiTFeeCKDrk7FbgjyFVVVujVf5Lz7u7goyyloJ syamRJnI6xFpsSj0ffu8K8i8JakWvWS+UC1RfvRM1H0kNHPNgncteOjItHRjD2Cv/8mj VI/tO3YH/qKjGgKeJzuAzWbP7DJqKBGvWLOjz9f15waDHboDv8r49dRpEfAlBikwvyvV aUgg== 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=erbV+L4TRYoVXS/pRZYHZrdS+5aC4zTLnh7N20zZh3k=; b=U1usHMukgLXFkTAEFZWvB5UYtM/TgeFQ4r17DUlG82vRuB1DzbsrZuEm1eu6Xldn9h 5R2+rr5ThMjU1nvONQWHGODlbC56sZl8DAVi/y1KsIB4nn0hwbVX/UfsLSFy2WiDwZAQ rtOMypxO3xXRN2eJPd6SeSwXDDMqZVeuYwnc5mNwN2DzPm6KB9axBOmiLm/TBLtRdf2m 7ggQanRVJoCKmcnTsE5QxtwRtmY8NgqEQ1zs52+zeZ3x0CzGgGoik/HqKBw4KTE25IdJ dv3G2XzmndvL5CmcjsQ5I2lpeNa/gvSEJEvj1R/MhL7pC+s6GHjJ685T13rI1g2R2sgb hDoA== X-Gm-Message-State: AODbwcDeHkMWvASgZbZPsRgtZqHu7vAID1nNjHtrLIRIfGwSQvrr1MiP AcnAVpuil8m6OBYlISx/WjEzeGHE2QFX X-Received: by 10.13.227.67 with SMTP id m64mr8880949ywe.8.1494299253802; Mon, 08 May 2017 20:07:33 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.49.65 with HTTP; Mon, 8 May 2017 20:06:53 -0700 (PDT) In-Reply-To: References: <0B8CBB75-11C6-40B0-A458-E8F8CDB172A1@googlemail.com> <21C5F4F1-30F8-4AFD-B00F-2B401CC54505@bamlabs.com> <796FA59D-D873-4440-9BC7-D77C3A82B777@googlemail.com> From: kurt greaves Date: Tue, 9 May 2017 03:06:53 +0000 Message-ID: Subject: Re: Smart Table creation for 2D range query To: Anthony Grasso Cc: Lydia Ickler , user@cassandra.apache.org Content-Type: multipart/alternative; boundary=94eb2c07d65c3619eb054f0ea8cb archived-at: Tue, 09 May 2017 03:07:42 -0000 --94eb2c07d65c3619eb054f0ea8cb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Note that will not give you the desired range queries of 0 >=3D x <=3D 1 an= d 0 >=3D y <=3D 1. =E2=80=8BSomething akin to Jon's solution could give you those range querie= s if you made the x and y components part of the clustering key. For example, a space of (1,1) could contain all x,y coordinates where x and y are > 0 and <=3D 1. You would then have a table like: CREATE TABLE geospatial ( space text, x double, y double, item text, m1, m2, m3, primary key ((space), x, y, m1, m2, m3, m4, m5) ); A query of select * where space =3D '1,1' and x <1 and x >0.5 and y< 0.2 an= d y>0.1; should yield all x and y pairs and their distinct metadata. Or something like that anyway. --94eb2c07d65c3619eb054f0ea8cb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Note that will not give you the desired range queries of 0= >=3D x <=3D 1 and 0 >=3D y <=3D 1.


=E2=80=8BSomething akin to Jon's solution could give you those range = queries if you made the x and y components part of the clustering key.
=
For example, a space of (1,1) could contain all x,y coordina= tes where x and y are > 0 and <=3D 1. You would then have a table lik= e:

CREATE TABLE geospatial (
space = text,
x double,
y double,
item text,
m1,
m2,
m3,
primary key ((space), x, y, m1,= m2, m3, m4, m5)
);

A query of sel= ect * where space =3D '1,1' and x <1 and x >0.5 and y< 0.2= and y>0.1; should yield all x and y pairs and their distinct metadata. = Or something like that anyway.

--94eb2c07d65c3619eb054f0ea8cb--