Re: Issue with ALLOW FILTERING

2014-08-06 Thread Jens Rantil
Hi Sávio,

I am really surprised by this. Could anyone explain why ALLOW FILTERING
only is allowed when using secondary index and not together with a PRIMARY
KEY? I'm struggling to see any reason for it not being supported.

Also, I don't believe the CQL specification makes it entirely clear that
only secondary indexes are supported. Or is it considered implementation
specific under what circumstances ALLOW FILTERING can be used?

Thanks,
Jens


On Tue, Aug 5, 2014 at 8:11 PM, Sávio S. Teles de Oliveira 
savio.te...@cuia.com.br wrote:

 You need to create an index on attribute *c.*


 2014-08-05 9:24 GMT-03:00 Jens Rantil jens.ran...@tink.se:

 Hi,

 I'm having an issue with ALLOW FILTERING with Cassandra 2.0.8. See a
 minimal example here:
 https://gist.github.com/JensRantil/ec43622c26acb56e5bc9

 I expect the second last to fail, but the last query to return a single
 row. In particular I expect the last SELECT to first select using the
 clustering primary id and then do filtering.

 I've been reading
 https://cassandra.apache.org/doc/cql3/CQL.html#selectStmt ALLOW
 FILTERING and can't wrap my head around why this won't work.

 Could anyone clarify this for me?

 Thanks,
 Jens




 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 CUIA Internet Brasil



Re: Issue with ALLOW FILTERING

2014-08-06 Thread Sylvain Lebresne
On Wed, Aug 6, 2014 at 9:41 AM, Jens Rantil jens.ran...@tink.se wrote


 I'm struggling to see any reason for it not being supported.


The time to implement it, plus a bunch of internal implementation reasons
that makes it not as trivial to support as you seem to suggest it is (of
course, this is open source, you are welcome to have a look if that's a
particular itch you want to scratch; there is even a JIRA ticket:
https://issues.apache.org/jira/browse/CASSANDRA-6377).



 Or is it considered implementation specific under what circumstances ALLOW
 FILTERING can be used?


Currently, it kind of is. ALLOW FILTERING allows to execute some queries
that couldn't be otherwise, but not everything. Again, things that are not
supported are not mainly for implementation reasons, nothing more, and that
may/will change in the future. That said, I'm not saying documentation
cannot be improved (though I'm not sure having the doc saying this doesn't
work would be a lot more helpful than trying it and having the
implementation saying this doesn't work).

--
Sylvain



 Thanks,
 Jens


 On Tue, Aug 5, 2014 at 8:11 PM, Sávio S. Teles de Oliveira 
 savio.te...@cuia.com.br wrote:

 You need to create an index on attribute *c.*


 2014-08-05 9:24 GMT-03:00 Jens Rantil jens.ran...@tink.se:

 Hi,

 I'm having an issue with ALLOW FILTERING with Cassandra 2.0.8. See a
 minimal example here:
 https://gist.github.com/JensRantil/ec43622c26acb56e5bc9

 I expect the second last to fail, but the last query to return a single
 row. In particular I expect the last SELECT to first select using the
 clustering primary id and then do filtering.

 I've been reading
 https://cassandra.apache.org/doc/cql3/CQL.html#selectStmt ALLOW
 FILTERING and can't wrap my head around why this won't work.

 Could anyone clarify this for me?

 Thanks,
 Jens




 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 CUIA Internet Brasil





Re: Issue with ALLOW FILTERING

2014-08-06 Thread Jens Rantil
Sylvain,

Your answer was what I was hoping for - that means it's not impossible to
solve ;)

I'll keep an eye on the issue and in case I have the time I will dig into
some code.

Thanks,
Jens


On Wed, Aug 6, 2014 at 10:03 AM, Sylvain Lebresne sylv...@datastax.com
wrote:

 On Wed, Aug 6, 2014 at 9:41 AM, Jens Rantil jens.ran...@tink.se wrote


 I'm struggling to see any reason for it not being supported.


 The time to implement it, plus a bunch of internal implementation reasons
 that makes it not as trivial to support as you seem to suggest it is (of
 course, this is open source, you are welcome to have a look if that's a
 particular itch you want to scratch; there is even a JIRA ticket:
 https://issues.apache.org/jira/browse/CASSANDRA-6377).



 Or is it considered implementation specific under what circumstances
 ALLOW FILTERING can be used?


 Currently, it kind of is. ALLOW FILTERING allows to execute some queries
 that couldn't be otherwise, but not everything. Again, things that are not
 supported are not mainly for implementation reasons, nothing more, and that
 may/will change in the future. That said, I'm not saying documentation
 cannot be improved (though I'm not sure having the doc saying this doesn't
 work would be a lot more helpful than trying it and having the
 implementation saying this doesn't work).

 --
 Sylvain



 Thanks,
 Jens


 On Tue, Aug 5, 2014 at 8:11 PM, Sávio S. Teles de Oliveira 
 savio.te...@cuia.com.br wrote:

 You need to create an index on attribute *c.*


 2014-08-05 9:24 GMT-03:00 Jens Rantil jens.ran...@tink.se:

 Hi,

 I'm having an issue with ALLOW FILTERING with Cassandra 2.0.8. See a
 minimal example here:
 https://gist.github.com/JensRantil/ec43622c26acb56e5bc9

 I expect the second last to fail, but the last query to return a single
 row. In particular I expect the last SELECT to first select using the
 clustering primary id and then do filtering.

 I've been reading
 https://cassandra.apache.org/doc/cql3/CQL.html#selectStmt ALLOW
 FILTERING and can't wrap my head around why this won't work.

 Could anyone clarify this for me?

 Thanks,
 Jens




 --
 Atenciosamente,
 Sávio S. Teles de Oliveira
 voice: +55 62 9136 6996
 http://br.linkedin.com/in/savioteles
  Mestrando em Ciências da Computação - UFG
 Arquiteto de Software
 CUIA Internet Brasil






Re: Issue with ALLOW FILTERING

2014-08-06 Thread Robert Coli
On Wed, Aug 6, 2014 at 1:46 AM, Jens Rantil jens.ran...@tink.se wrote:

 Your answer was what I was hoping for - that means it's not impossible to
 solve ;)

 I'll keep an eye on the issue and in case I have the time I will dig into
 some code.


 Just have to mention here that :

ALLOW FILTERING should be renamed PROBABLY TIMEOUT in order to properly
describe its typical performance.

If you find yourself having to use ALLOW FILTERING, it is possible you are
Doing It Wrong.. :D

=Rob


Issue with ALLOW FILTERING

2014-08-05 Thread Jens Rantil
Hi,

I'm having an issue with ALLOW FILTERING with Cassandra 2.0.8. See a
minimal example here:
https://gist.github.com/JensRantil/ec43622c26acb56e5bc9

I expect the second last to fail, but the last query to return a single
row. In particular I expect the last SELECT to first select using the
clustering primary id and then do filtering.

I've been reading https://cassandra.apache.org/doc/cql3/CQL.html#selectStmt
ALLOW FILTERING and can't wrap my head around why this won't work.

Could anyone clarify this for me?

Thanks,
Jens


Re: Issue with ALLOW FILTERING

2014-08-05 Thread Sávio S . Teles de Oliveira
You need to create an index on attribute *c.*


2014-08-05 9:24 GMT-03:00 Jens Rantil jens.ran...@tink.se:

 Hi,

 I'm having an issue with ALLOW FILTERING with Cassandra 2.0.8. See a
 minimal example here:
 https://gist.github.com/JensRantil/ec43622c26acb56e5bc9

 I expect the second last to fail, but the last query to return a single
 row. In particular I expect the last SELECT to first select using the
 clustering primary id and then do filtering.

 I've been reading
 https://cassandra.apache.org/doc/cql3/CQL.html#selectStmt ALLOW
 FILTERING and can't wrap my head around why this won't work.

 Could anyone clarify this for me?

 Thanks,
 Jens




-- 
Atenciosamente,
Sávio S. Teles de Oliveira
voice: +55 62 9136 6996
http://br.linkedin.com/in/savioteles
Mestrando em Ciências da Computação - UFG
Arquiteto de Software
CUIA Internet Brasil