Re: Smart Table creation for 2D range query

2017-05-09 Thread Jim Ancona
> 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 = '1,1' and x <1 and x >0.5 and y< 0.2 > and y&g

Re: Smart Table creation for 2D range query

2017-05-08 Thread Jon Haddad
> item text, > m1, > m2, > m3, > primary key ((space), x, y, m1, m2, m3, m4, m5) > ); > > A query of select * where space = '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 th

Re: Smart Table creation for 2D range query

2017-05-08 Thread kurt greaves
here x and y are > 0 and <= 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 = '1,1' and x <1 and x >0.5 and y< 0.2 and y>0.1;

Re: Smart Table creation for 2D range query

2017-05-08 Thread Anthony Grasso
Hi Lydia, Yes. This will define the *x*, *y* columns as the components of the partition key. Note that by doing this both *x* and *y* values will be required to at a minimum to perform a valid query. Alternatively, the *x* and *y* values could be combined in into a single text field as Jon has

Re: Smart Table creation for 2D range query

2017-05-07 Thread Lydia Ickler
ated way. >> >> My aim is to store x- and y-coordinates, accompanied by some columns with >> meta information (m1, ... ,m5). There will be around 100,000,000 rows >> overall. Some rows might have the same (x,y) pairs but always distinct meta >> information. >

Re: Smart Table creation for 2D range query

2017-05-05 Thread Jon Haddad
n how to >> tackle a table creation / indexing in a sophisticated way. >> >> My aim is to store x- and y-coordinates, accompanied by some columns with >> meta information (m1, ... ,m5). There will be around 100,000,000 rows >> overall. Some rows might have the same (x,y) pair

Re: Smart Table creation for 2D range query

2017-05-05 Thread Nitan Kainth
always distinct meta > information. > > In the end I want to do a rather simple range query in the form of e.g. (0 >= > x <= 1) AND (0 >= y <= 1). > > What would be the best choice of variables to set as primary key, partition > key. Or should I use a index? And if s

Smart Table creation for 2D range query

2017-05-05 Thread Lydia
. Some rows might have the same (x,y) pairs but always distinct meta information. In the end I want to do a rather simple range query in the form of e.g. (0 >= x <= 1) AND (0 >= y <= 1). What would be the best choice of variables to set as primary key, partition key. Or should I

Re: Will query on PK read entire partition?

2017-04-25 Thread Vladimir Yudovin
a table like this: PRIMARY KEY ((userid),deviceid) And I query SELECT * FROM devices where userid= ? and deviceid = ? Will cassandra read the entire partition for the userid? So if I lots of tombstones for userid, will they get scanned? I guess this depends on how the bloomfilter

Re: Will query on PK read entire partition?

2017-04-21 Thread Alain RODRIGUEZ
Consulting http://www.thelastpickle.com 2017-04-21 10:44 GMT+02:00 Oskar Kjellin <oskar.kjel...@gmail.com>: > If I have a table like this: > > PRIMARY KEY ((userid),deviceid) > > And I query > SELECT * FROM devices where userid= ? and deviceid = ? > > Will cassa

Will query on PK read entire partition?

2017-04-21 Thread Oskar Kjellin
If I have a table like this: PRIMARY KEY ((userid),deviceid) And I query SELECT * FROM devices where userid= ? and deviceid = ? Will cassandra read the entire partition for the userid? So if I lots of tombstones for userid, will they get scanned? I guess this depends on how the bloomfilter

Re: Query on Data Modelling of a specific usecase

2017-04-20 Thread Naresh Yadav
Hi Jon, Thanks for your guidance. In above mentioned table i can have different scale depending on Report. One report may have 1 rows. Second report may have half million rows. Third report may have 1 million rows. Fourth report may have 10 million rows. As this is timeseries data that was

Re: Query on Data Modelling of a specific usecase

2017-04-19 Thread Jon Haddad
How much data do you plan to store in each table? I’ll be honest, this doesn’t sound like a Cassandra use case at first glance. 1 table per report x 1000 is going to be a bad time. Odds are with different queries, you’ll need multiple views, so lets call that a handful of tables per report.

Re: Query on Data Modelling of a specific usecase

2017-04-19 Thread Naresh Yadav
Looking for cassandra expert's recommendation on above usecase, please reply. On Mon, Apr 17, 2017 at 7:37 PM, Naresh Yadav wrote: > Hi all, > > This is my existing table configured on apache-cassandra-3.0.9: > > CREATE TABLE report_id1 ( >mc_id text, >tag_id text,

Query on Data Modelling of a specific usecase

2017-04-17 Thread Naresh Yadav
Hi all, This is my existing table configured on apache-cassandra-3.0.9: CREATE TABLE report_id1 ( mc_id text, tag_id text, e_date timestamp. value text PRIMARY KEY ((mc_id, tag_id), e_date) } I create table dynamically for each report from application. Need to support upto 1000

Re: Very odd & inconsistent results from SASI query

2017-03-20 Thread Voytek Jarnot
es <k...@instaclustr.com> >> wrote: >> >>> As secondary indexes are stored individually on each node what you're >>> suggesting sounds exactly like a consistency issue. the fact that you read >>> 0 cells on one query implies the node that got the query

Re: Very odd & inconsistent results from SASI query

2017-03-20 Thread Voytek Jarnot
; As secondary indexes are stored individually on each node what you're >> suggesting sounds exactly like a consistency issue. the fact that you read >> 0 cells on one query implies the node that got the query did not have any >> data for the row. The reason you would sometimes

Re: Very odd & inconsistent results from SASI query

2017-03-20 Thread Voytek Jarnot
issues may be. On Mon, Mar 20, 2017 at 2:42 PM, kurt greaves <k...@instaclustr.com> wrote: > As secondary indexes are stored individually on each node what you're > suggesting sounds exactly like a consistency issue. the fact that you read > 0 cells on one query implies the node tha

Re: Very odd & inconsistent results from SASI query

2017-03-20 Thread kurt greaves
As secondary indexes are stored individually on each node what you're suggesting sounds exactly like a consistency issue. the fact that you read 0 cells on one query implies the node that got the query did not have any data for the row. The reason you would sometimes see different behaviours

Re: Very odd & inconsistent results from SASI query

2017-03-17 Thread Voytek Jarnot
> with the same parameters tomorrow, they're likely to work correctly. > > Only thing I've been able to glean from tracing execution is that the > queries that work follow "Executing read..." with "Executing single > partition query on t1" and so forth, whereas the quer

Very odd & inconsistent results from SASI query

2017-03-17 Thread Voytek Jarnot
urther confounding the issue is that if my testers run these same queries with the same parameters tomorrow, they're likely to work correctly. Only thing I've been able to glean from tracing execution is that the queries that work follow "Executing read..." with "Executing single partition qu

Re: Trouble implementing CAS operation with LWT query

2017-02-22 Thread Edward Capriolo
On Wed, Feb 22, 2017 at 8:42 AM, 안정아 <jungah@samsung.com> wrote: > Hi, all > > > > I'm trying to implement a typical CAS operation with LWT query(conditional > update). > > But I'm having trouble keeping integrity of the result when > WriteTimeoutExcept

Trouble implementing CAS operation with LWT query

2017-02-22 Thread 안정아
Hi, all   I'm trying to implement a typical CAS operation with LWT query(conditional update). But I'm having trouble keeping integrity of the result when WriteTimeoutException occurs. according to http://www.datastax.com/dev/blog/cassandra-error-handling-done-right "If the paxos

Re: is there a query to find out the largest partition in a table?

2017-02-18 Thread Kant Kodali
t;k...@peernova.com> wrote: > is there a query to find out the largest partition in a table? Does the > query below give me the largest partition? > > select max(mean_partition_size) from size_estimates ; > > Thanks, > Kant >

is there a query to find out the largest partition in a table?

2017-02-18 Thread Kant Kodali
is there a query to find out the largest partition in a table? Does the query below give me the largest partition? select max(mean_partition_size) from size_estimates ; Thanks, Kant

RE: Query on Cassandra clusters

2017-01-03 Thread SEAN_R_DURITY
[mailto:sumit.anve...@gmail.com] Sent: Wednesday, December 21, 2016 3:47 PM To: user@cassandra.apache.org Subject: Re: Query on Cassandra clusters Thank you Alain for the detailed explanation. To answer you question on Java version, JVM settings and Memory usage. We are using using 1.8.0_45

Re: Query

2016-12-30 Thread Work
om> > Sent: Friday, December 30, 2016 5:53 AM > To: user@cassandra.apache.org > Subject: Re: Query > > You should start with understanding your needs. Once you understand your need > you can pick the software that fits your need. Staring with a software stack > is backwar

RE: Query

2016-12-30 Thread SEAN_R_DURITY
studies, too, with their enterprise version of Cassandra: http://www.datastax.com/resources/casestudies Sean Durity From: Sikander Rafiq [mailto:hafiz_ra...@hotmail.com] Sent: Friday, December 30, 2016 8:00 AM To: user@cassandra.apache.org Subject: Re: Query Thanks for your comments/suggestions

Re: Query

2016-12-30 Thread Sikander Rafiq
2016 5:53 AM To: user@cassandra.apache.org Subject: Re: Query You should start with understanding your needs. Once you understand your need you can pick the software that fits your need. Staring with a software stack is backwards. On Thu, Dec 29, 2016 at 11:34 PM, Ben Slater <ben.sla...@

Re: Query

2016-12-29 Thread Edward Capriolo
You should start with understanding your needs. Once you understand your need you can pick the software that fits your need. Staring with a software stack is backwards. On Thu, Dec 29, 2016 at 11:34 PM, Ben Slater wrote: > I wasn’t familiar with Gizzard either so I

Re: Query

2016-12-29 Thread Ben Slater
I wasn’t familiar with Gizzard either so I thought I’d take a look. The first things on their github readme is: *NB: This project is currently not recommended as a base for new consumers.* (And no commits since 2013) So, Cassandra definitely looks like a better choice as your datastore for a new

Re: Query

2016-12-29 Thread Manoj Khangaonkar
I am not that familiar with gizzard but with gizzard + mysql , you have multiple moving parts in the system that need to managed separately. You'll need the mysql expert for mysql and the gizzard expert to manage the distributed part. It can be argued that long term this will have higher

Query

2016-12-29 Thread Sikander Rafiq
Hi, I'm exploring Cassandra for handling large data sets for mobile app, but i'm not clear where it stands. If we use MySQL as underlying database and Gizzard for building custom distributed databases (with arbitrary storage technology) and Memcached for highly queried data, then where lies

Re: Comment on query performance

2016-12-29 Thread Ashutosh Dhundhara
t; >>> On Thu, Dec 29, 2016 at 10:00 AM, Ashutosh Dhundhara < >>> ashutoshdhundh...@yahoo.com> wrote: >>> >>>> Hi All, >>>> >>>> I have a table like this: >>>> >>>> CREATE TABLE IF NOT EXISTS Posts ( >>&

Re: Comment on query performance

2016-12-29 Thread DuyHai Doan
is: >>> >>> CREATE TABLE IF NOT EXISTS Posts ( >>> idObject int, >>> objectType text, >>> idParent int, >>> id int, >>> idResolution int, >>> PRIMARY KEY ((idObject, objectType, idParent), id) >>> )

Re: Comment on query performance

2016-12-29 Thread Ashutosh Dhundhara
t; I have a table like this: >> >> CREATE TABLE IF NOT EXISTS Posts ( >> idObject int, >> objectType text, >> idParent int, >> id int, >> idResolution int, >> PRIMARY KEY ((idObject, objectType, idParent), id) >&g

Re: Comment on query performance

2016-12-29 Thread DuyHai Doan
t), id) > ); > > Now have a look at the following query: > > SELECT * FROM POSTS WHERE idobject = 1 AND objectType = 'COURSE' AND idParent > = 0 AND idResolution = 1 ALLOW FILTERING > > Now the Partition Key is completely known, so if I use ALLOW FILTERING is > there g

Comment on query performance

2016-12-29 Thread Ashutosh Dhundhara
Hi All, I have a table like this: CREATE TABLE IF NOT EXISTS Posts ( idObject int, objectType text, idParent int, id int, idResolution int, PRIMARY KEY ((idObject, objectType, idParent), id) ); Now have a look at the following query: SELECT * FROM POSTS WHERE idobject

Re: Query on Cassandra clusters

2016-12-21 Thread Sumit Anvekar
Thank you Alain for the detailed explanation. To answer you question on Java version, JVM settings and Memory usage. We are using using 1.8.0_45. precisely >java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build

Re: Query on Cassandra clusters

2016-12-21 Thread Alain RODRIGUEZ
Hi Sumit, 1. I have a Cassandra cluster with 11 nodes, 5 of which have Cassandra > version 3.0.3 and then newer 5 nodes have 3.6.0 version. I strongly recommend to: - Stick with one version of Apache Cassandra per cluster. - Always be as close as possible from the last minor release of

Query on Cassandra clusters

2016-12-20 Thread Sumit Anvekar
I have a couple questions. 1. I have a Cassandra cluster with 11 nodes, 5 of which have Cassandra version 3.0.3 and then newer 5 nodes have 3.6.0 version. I has been running fine until recently I am seeing higher amount of data residing in newer boxes. The configuration file (YAML file) is

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Jeff Jirsa
On 2016-12-03 08:44 (-0800), Edward Capriolo wrote: > On Sat, Dec 3, 2016 at 11:01 AM, Edward Capriolo > wrote: > > > > > > > A new unique timeuuid (at the time where the statement using it is > > executed). > > > > Indicates that each statement

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
g I guess, and we can switch to >>>>>>> discussing that, but it's a different problem really and I'm not a fond >>>>>>> of >>>>>>> derailing threads. I will just note though that if we're not talking >>>>>>>

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
not talking about a >>>>>> confusion issue but rather how to get a timeuuid to be fixed within a >>>>>> statement, then there is much much more trivial solution: generate it >>>>>> client side. The `now()` function is a small convenience but ther

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
n: generate it >>>>> client side. The `now()` function is a small convenience but there is >>>>> nothing you cannot do without it client side, and that actually basically >>>>> stands for almost any use of (non aggregate) function in Cassandra >>>>&g

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Jonathan Haddad
is > nothing you cannot do without it client side, and that actually basically > stands for almost any use of (non aggregate) function in Cassandra > currently. > > > > > "Food for thought: Hive's UDFs introduced an annotation > @UDFType(deterministic > = false) > &g

Re: Why does `now()` produce different times within the same query?

2016-12-03 Thread Edward Capriolo
small convenience but there is >>> nothing you cannot do without it client side, and that actually basically >>> stands for almost any use of (non aggregate) function in Cassandra >>> currently. >>> >>> >>>> >>>> >>

Re: Why does `now()` produce different times within the same query?

2016-12-02 Thread Jonathan Haddad
a > currently. > > > > > "Food for thought: Hive's UDFs introduced an annotation > @UDFType(deterministic > = false) > > > http://dmtolpeko.com/2014/10/15/invoking-stateful-udf-at-map-and-reduce-side-in-hive/ > > The effect is the query planner can see when su

Re: Why does `now()` produce different times within the same query?

2016-12-02 Thread Edward Capriolo
urrently. > > >> >> >> "Food for thought: Hive's UDFs introduced an annotation >> @UDFType(deterministic = false) >> >> http://dmtolpeko.com/2014/10/15/invoking-stateful-udf-at-map >> -and-reduce-side-in-hive/ >> >> The effect is t

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Ben Bromhead
behaviour. And how is >that actually useful: you're having different result anyway and you're >letting the server pick the timestamp in the first place, so you're > probably >not caring about milliseconds precision of that timestamp in the first > place. > If you want con

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Marko Švaljek
One millisecond is not an issue in most of Internet of Things projects out there. There are lots of connection related things that add far more latency to the requests than that. Especially if you take into account the time it takes for the data to actually come to a cassandra node in the

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Cody Yancey
On Thu, Dec 1, 2016 at 11:09 AM Sylvain Lebresne wrote: > there is much much more trivial solution: generate it client side. The > `now()` function is a small convenience but there is nothing you cannot do > without it client side > Please see my post above as to why this

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Edward Capriolo
urrently. > > >> >> >> "Food for thought: Hive's UDFs introduced an annotation >> @UDFType(deterministic = false) >> >> http://dmtolpeko.com/2014/10/15/invoking-stateful-udf-at-map >> -and-reduce-side-in-hive/ >> >> The effect is t

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Jonathan Haddad
Cassandra > currently. > > > > > "Food for thought: Hive's UDFs introduced an annotation > @UDFType(deterministic > = false) > > > http://dmtolpeko.com/2014/10/15/invoking-stateful-udf-at-map-and-reduce-side-in-hive/ > > The effect is the query planner ca

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Sylvain Lebresne
ful-udf-at-map > -and-reduce-side-in-hive/ > > The effect is the query planner can see when such a UDF is in use and > determine the value once at the start of a very long query." > > Essentially hive had a similar if not identical problem, during a long > running distributed proces

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Bruce Heath
Get Outlook for Android<https://aka.ms/ghei36> From: Edward Capriolo <edlinuxg...@gmail.com> Sent: Thursday, December 1, 2016 10:44:10 AM To: user@cassandra.apache.org Subject: Re: Why does `now()` produce different times within the same query? O

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Edward Capriolo
rote: >>>> >>>> Getting the same TimeUUID values might be a major problem. Getting two >>>> different TimeUUIDs that at least have time component would not be a major >>>> problem as this is the main case today. Getting different time components &g

Re: Why does `now()` produce different times within the same query?

2016-12-01 Thread Sylvain Lebresne
and it is a corner case that breaks >>> Internet-of-Things applications. We can tightly control clock skew in our >>> cluster. We most definitely CANNOT control clock skew on the thousands of >>> sensors that write to our cluster. >>> >>> Thanks, >

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Benjamin Roth
t;> inserts the value returned by now(). Getting the same UUID for each insert >> would be a major problem. >> >> Cheers >> >> Robert >> >> >> On Nov 30, 2016, at 4:46 PM, Todd Fast <t...@digitalexistence.com> wrote: >> >> FWIW I'd suggest o

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Ben Bromhead
te > unexpected and more than just a documentation issue. In general I can't > imagine any desirable properties of the current implementation, and there > are likely a bunch of latent bugs sitting out there, so it should be fixed. > > Todd > > On Wed, Nov 30, 2016 at 12:37 PM Terry

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Edward Capriolo
gt;> Cheers >>>> >>>> Robert >>>> >>>> >>>> On Nov 30, 2016, at 4:46 PM, Todd Fast <t...@digitalexistence.com> >>>> wrote: >>>> >>>> FWIW I'd suggest opening a bug--this behavior is certainly q

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Cody Yancey
italexistence.com> >>> wrote: >>> >>> FWIW I'd suggest opening a bug--this behavior is certainly quite >>> unexpected and more than just a documentation issue. In general I can't >>> imagine any desirable properties of the current implementation, an

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread daemeon reiydelle
bugs sitting out there, so it should be fixed. >> >> Todd >> >> On Wed, Nov 30, 2016 at 12:37 PM Terry Liu <t...@turnitin.com> wrote: >> >>> Sorry for my typo. Obviously, I meant: >>> "It appears that a single query that calls Cassandra's`

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Cody Yancey
ikely a bunch of latent bugs sitting out there, so it should be fixed. > > Todd > > On Wed, Nov 30, 2016 at 12:37 PM Terry Liu <t...@turnitin.com> wrote: > >> Sorry for my typo. Obviously, I meant: >> "It appears that a single query that calls Cassandra's`now()`

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Robert Wille
e are likely a bunch of latent bugs sitting out there, so it should be fixed. Todd On Wed, Nov 30, 2016 at 12:37 PM Terry Liu <t...@turnitin.com<mailto:t...@turnitin.com>> wrote: Sorry for my typo. Obviously, I meant: "It appears that a single query that calls Cassandra's`now()`

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Todd Fast
On Wed, Nov 30, 2016 at 12:37 PM Terry Liu <t...@turnitin.com> wrote: > Sorry for my typo. Obviously, I meant: > "It appears that a single query that calls Cassandra's`now()` time > function *multiple times *may actually cause a query to write or return > different times."

Re: Why does `now()` produce different times within the same query?

2016-11-30 Thread Terry Liu
Sorry for my typo. Obviously, I meant: "It appears that a single query that calls Cassandra's`now()` time function *multiple times *may actually cause a query to write or return different times." Less of a surprise now that I realize more about the implementation, but I agree that mor

Re: Why does `now()` produce different times within the same query?

2016-11-29 Thread Marko Švaljek
-11-29 22:49 GMT+01:00 Terry Liu <t...@turnitin.com>: > It appears that a single query that calls Cassandra's `now()` time > function may actually cause a query to write or return different times. > > Is this the expected or defined behavior, and if so, why does it behave >

Re: Why does `now()` produce different times within the same query?

2016-11-29 Thread Ariel Weisberg
ax.com/en/cql/3.3/cql/cql_using/useWritetime.html for each column. Writetime didn't seem have hits in the Apache docs so I linked to the Datastax docs. I'll see about getting them updated. Regards, Ariel On Tue, Nov 29, 2016, at 04:49 PM, Terry Liu wrote: > It appears that a single query that calls Cassa

Why does `now()` produce different times within the same query?

2016-11-29 Thread Terry Liu
It appears that a single query that calls Cassandra's `now()` time function may actually cause a query to write or return different times. Is this the expected or defined behavior, and if so, why does it behave like this rather than evaluating `now()` once across an entire statement? This really

"java.io.IOError: java.io.EOFException: EOF after 13889 bytes out of 460861" occured when I query from a table

2016-10-31 Thread ????/??????
and 'tblA' using cql, it throw the follwing exception. query from viewA: "ServerError: " and query from tblA: "ServerError: " My system version is : Cassandra 3.7 + spark1.6.2 + Spark Cassandra Connector 1.6 If anyone know ab

Re: Cassandra failure during read query at consistency QUORUM (2 responses were required but only 0 replica responded, 2 failed)

2016-10-30 Thread Denis Mikhaylov
ylov <notxc...@gmail.com> wrote: > Hi! > > We’re running Cassandra 3.9 > > On the application side I see failed reads with this exception > com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure > during read query at consistency QUORUM (2 respons

Re: Cassandra failure during read query at consistency QUORUM (2 responses were required but only 0 replica responded, 2 failed)

2016-10-28 Thread Edward Capriolo
s with this exception > com.datastax.driver.core.exceptions.ReadFailureException: Cassandra > failure during read query at consistency QUORUM (2 responses were required > but only 0 replica responded, 2 failed) > > On the server side we see: > > WARN [SharedPool-Worker-3] 2016-10-28 13:28:22,965 &g

Cassandra failure during read query at consistency QUORUM (2 responses were required but only 0 replica responded, 2 failed)

2016-10-28 Thread Denis Mikhaylov
Hi! We’re running Cassandra 3.9 On the application side I see failed reads with this exception com.datastax.driver.core.exceptions.ReadFailureException: Cassandra failure during read query at consistency QUORUM (2 responses were required but only 0 replica responded, 2 failed) On the server

Re: Cannot restrict clustering columns by IN relations when a collection is selected by the query

2016-10-27 Thread DuyHai Doan
oup of member ids. > > I think it would be more efficient to do this as an IN query of the type: > *project_id > = x AND member_id IN (...)*, instead of doing multiple queries of: *project_id > = x AND member_id = y* > > I tried to setup an accessor for this, as the following:

Cannot restrict clustering columns by IN relations when a collection is selected by the query

2016-10-27 Thread Ali Akhtar
*);* I have a scenario where I need to show all tickets for a particular project, by a group of member ids. I think it would be more efficient to do this as an IN query of the type: *project_id = x AND member_id IN (...)*, instead of doing multiple queries of: *project_id = x AND member_id =

Re: Cannot restrict clustering columns by IN relations when a collection is selected by the query

2016-10-23 Thread Samba
enter < > jeff.carpen...@choicehotels.com> wrote: > >> Hello >> >> Consider the following schema: >> >> CREATE TABLE rates_by_code ( >> hotel_id text, >> rate_code text, >> rates set, >> description text, >> PRIM

Re: Cannot restrict clustering columns by IN relations when a collection is selected by the query

2016-10-21 Thread DuyHai Doan
E TABLE rates_by_code ( > hotel_id text, > rate_code text, > rates set, > description text, > PRIMARY KEY ((hotel_id), rate_code) > ); > > When executing the query: > > select rates from rates_by_code where hotel_id='AZ123' and rate_code IN > ('ABC', 'DEF', 'GHI'); &

Cannot restrict clustering columns by IN relations when a collection is selected by the query

2016-10-21 Thread Jeff Carpenter
Hello Consider the following schema: CREATE TABLE rates_by_code ( hotel_id text, rate_code text, rates set, description text, PRIMARY KEY ((hotel_id), rate_code) ); When executing the query: select rates from rates_by_code where hotel_id='AZ123' and rate_code IN ('ABC', 'DEF', 'GHI

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Justin Cameron
tion key and/or the last column in the full primary key. Example: 'Select * from my_table WHERE pk = 'test' And ck IN (1, 2)' On Tue, 11 Oct 2016 at 06:15 Ali Akhtar <ali.rac...@gmail.com> wrote: If I wanted to create an accessor, and have a method which does a query like this: 'S

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Justin Cameron
last column in the partition key and/or the last column in the full primary key. Example: 'Select * from my_table WHERE pk = 'test' And ck IN (1, 2)' On Tue, 11 Oct 2016 at 06:15 Ali Akhtar <ali.rac...@gmail.com> wrote: If I wanted to create an accessor, and have a method which

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Ali Akhtar
artition key and/or the last column in the > full primary key. > > Example: > > 'Select * from my_table WHERE pk = 'test' And ck IN (1, 2)' > > > On Tue, 11 Oct 2016 at 06:15 Ali Akhtar <ali.rac...@gmail.com> wrote: > > If I wanted to create an accessor, and have a

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Ali Akhtar
? > (Without the brackets around the question mark) > > regards, > Ch > > On Tue, Oct 11, 2016 at 3:14 PM, Ali Akhtar <ali.rac...@gmail.com> wrote: > >> If I wanted to create an accessor, and have a method which does a query >> like this: >> >> 'Sele

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Ali Akhtar
artition key and/or the last column in the > full primary key. > > Example: > > 'Select * from my_table WHERE pk = 'test' And ck IN (1, 2)' > > > On Tue, 11 Oct 2016 at 06:15 Ali Akhtar <ali.rac...@gmail.com> wrote: > >> If I wanted to create an acc

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread horschi
Hi Ali, do you perhaps want "'Select * from my_table WHERE pk = ? And ck IN ?'" ? (Without the brackets around the question mark) regards, Ch On Tue, Oct 11, 2016 at 3:14 PM, Ali Akhtar <ali.rac...@gmail.com> wrote: > If I wanted to create an accessor, and have a method

Re: Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Justin Cameron
rac...@gmail.com> wrote: > If I wanted to create an accessor, and have a method which does a query > like this: > > 'Select * from my_table WHERE pk = ? And ck IN (?)' > > And there were multiple options that could go inside the IN() query, how > can I specify that? Will it e.g, let me

Java Driver - Specifying parameters for an IN() query?

2016-10-11 Thread Ali Akhtar
If I wanted to create an accessor, and have a method which does a query like this: 'Select * from my_table WHERE pk = ? And ck IN (?)' And there were multiple options that could go inside the IN() query, how can I specify that? Will it e.g, let me pass in an array as the 2nd variable?

Re: Doing a calculation in a query?

2016-10-10 Thread DuyHai Doan
gt; > If order made on Jan 1, but not yet shipped, and today is Jan 10th, then > shipment_delay = 10 days. > > I then need to sort the orders in the order of 'shipment_delay desc', i.e > show the orders which took the longest, at the top. > > Is it possible to define 'shipment

Doing a calculation in a query?

2016-10-10 Thread Ali Akhtar
of 'shipment_delay desc', i.e show the orders which took the longest, at the top. Is it possible to define 'shipment_delay' at the table or query level, so it can be used in the 'order by' clause, or if this ordering will have to be done myself after the data is received? Thanks.

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-10-04 Thread Mikhail Krupitskiy
Please see my comments inline. Thanks, Mikhail > On 26 Sep 2016, at 17:07, DuyHai Doan wrote: > > "In the current implementation (‘%’ could be a wildcard only at the start/end > of a term) I guess it should be ’ENDS with ‘%escape’ ‘." > > --> Yes in the current impl, it

Contains-query leads to error when list in selected row is empty

2016-09-28 Thread Michael Mirwaldt
; CREATE TABLE mykeyspace.mytable (partitionkey text, mylist list, PRIMARY KEY (partitionkey)); If I add the value INSERT INTO mykeyspace.mytable(partitionkey,mylist) VALUES('A',['1']); and query select * from mykeyspace.mytable; I get partitionkey | mylist

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-26 Thread DuyHai Doan
"In the current implementation (‘%’ could be a wildcard only at the start/end of a term) I guess it should be ’ENDS with ‘%escape’ ‘." --> Yes in the current impl, it means ENDS WITH '%escape' but we want SASI to understand the %% as an escape for % so the goal is that SASI understands LIKE

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-26 Thread Mikhail Krupitskiy
> LIKE '%%%escape' --> EQUALS TO '%%escape' ??? In the current implementation (‘%’ could be a wildcard only at the start/end of a term) I guess it should be ’ENDS with ‘%escape’ ‘. Moreover all terms that contains single ‘%’ somewhere in the middle should cause an exception. BUT may be it’s

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-24 Thread DuyHai Doan
Reminder, right now, the % character is only interpreted as wildcard IF AND ONLY IF it is the first/last character of the searched term LIKE '%escape' --> ENDS WITH 'escape' If we use % to escape %, LIKE '%%escape' --> EQUALS TO '%escape' LIKE '%%%escape' --> EQUALS TO '%%escape' ??? On

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-23 Thread Mikhail Krupitskiy
Hi, Jim, What pattern should be used to search “ends with ‘%escape’ “ with your conception? Thanks, Mikhail > On 22 Sep 2016, at 18:51, Jim Ancona wrote: > > To answer DuyHai's question without introducing new syntax, I'd suggest: >> LIKE '%%%escape' means STARTS WITH

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-22 Thread Jim Ancona
To answer DuyHai's question without introducing new syntax, I'd suggest: LIKE '%%%escape' means STARTS WITH '%' AND ENDS WITH 'escape' So the first two %'s are translated to a literal, non-wildcard % and the third % is a wildcard because it's not doubled. Jim On Thu, Sep 22, 2016 at 11:40 AM,

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-22 Thread Mikhail Krupitskiy
I guess that it should be similar to how it is done in SQL for LIKE patterns. You can introduce an escape character, e.g. ‘\’. Examples: ‘%’ - any string ‘\%’ - equal to ‘%’ character ‘\%foo%’ - starts from ‘%foo’ ‘%%%escape’ - ends with ’escape’ ‘\%%’ - starts from ‘%’ ‘\\\%%’ - starts from ‘\%’

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-22 Thread DuyHai Doan
Hello Mikhail It's more complicated that it seems LIKE '%%escape' means EQUAL TO '%escape' LIKE '%escape' means ENDS WITH 'escape' What's about LIKE '%%%escape' How should we treat this case ? Replace %% by % at the beginning of the searched term ?? On Thu, Sep 22, 2016 at 3:31 PM,

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-22 Thread Mikhail Krupitskiy
Hi! We’ve talked about two items: 1) ‘%’ as a wildcard in the middle of LIKE pattern. 2) How to escape ‘%’ to be able to find strings with the ‘%’ char with help of LIKE. Item #1was resolved as CASSANDRA-12573. Regarding to item #2: you said the following: > A possible fix would be: > > 1)

Re: How to query '%' character using LIKE operator in Cassandra 3.7?

2016-09-20 Thread Mikhail Krupitskiy
Hi! Have you had a chance to try your patch or solve the issue in an other way? Thanks, Mikhail > On 15 Sep 2016, at 16:02, DuyHai Doan wrote: > > Ok so I've found the source of the issue, it's pretty well hidden because it > is NOT in the SASI source code directly. >

<    1   2   3   4   5   6   7   8   9   10   >