cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain RODRIGUEZ <arodr...@gmail.com>
Subject Re: Duplicated key with an IN statement
Date Thu, 04 Feb 2016 10:54:49 GMT
Hi,

This is interesting.

It seems rational that if you are looking at 2 keys and both exist (which
is the case) it returns you 2 keys, it. Yet, I just checked this kind of
command on MySQL and it gives a one line result. So here CQL differs from
SQL (at least MySQL). I know we are trying to fit as much as possible with
SQL to avoid loosing people, so we might want to change this.
Not sure if this behavior is intentional / known. Not even sure someone
ever tried to do this kind of query actually :).

Does anyone know about that ? Should we raise a ticket ?

-----------------
Alain Rodriguez
France

The Last Pickle
http://www.thelastpickle.com



2016-02-04 8:36 GMT+00:00 Edouard COLE <Edouard.COLE@rgsystem.com>:

> Hello,
>
> I just discovered this, and I think this is weird:
>
> ed@debian:~$ cqlsh 192.168.10.8
> Connected to _CLUSTER_ at 192.168.10.8:9160.
> [cqlsh 4.0.1 | Cassandra 2.0.14.459 | CQL spec 3.1.1 | Thrift protocol
> 19.39.0]
> Use HELP for help.
> cqlsh> USE ks-test ;
> cqlsh:ks-test> CREATE TABLE t (
>             ...     key int,
>             ...     value int,
>             ...     PRIMARY KEY (key)
>             ... );
> cqlsh:ks-test> INSERT INTO t (key, value) VALUES (123, 456) ;
> cqlsh:ks-test> SELECT * FROM t ;
>
>  key | value
> -----+-------
>  123 |   456
>
> (1 rows)
>
> cqlsh:ks-test> SELECT * FROM t WHERE key IN (123, 123);
>
>  key | value
> -----+-------
>  123 |   456
>  123 |   456 <----- WTF?
>
> (2 rows)
>
> Adding multiple time the same key into an IN statement make the query
> returns multiple time the tuple
>
> This looks weird to me, can anyone give me some feedback on such a
> behavior?
>
> Edouard COLE
>
>

Mime
View raw message