[
https://issues.apache.org/jira/browse/CASSANDRA-3791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13200380#comment-13200380
]
Sylvain Lebresne commented on CASSANDRA-3791:
---------------------------------------------
It's not really important but for info, the test seems to fail here with
{noformat}
File "/Users/mcmanus/Git/scqeal/scqeal/tests/test_select.py", line 370, in
compactcf_query_by_names_test
self.assertIn(1328129600682, list(column_values(rows)))
AttributeError: 'TestSelect' object has no attribute 'assertIn'
{noformat}
However, I look at the queries and result on that test and I didn't see
anything wrong on what's returned. However, the test is asserting wrong things.
When inserting data in the 'Clicks' CF, for the second userid
(d9c9dced-d539-4bce-9ccb-dc59a9e9136f), you update the same column multiple
times. The inserts look like:
{noformat}
INSERT INTO Clicks (userid, url, time) VALUES
(d9c9dced-d539-4bce-9ccb-dc59a9e9136f, 'http://apache.org', 1328129787426);
INSERT INTO Clicks (userid, url, time) VALUES
(d9c9dced-d539-4bce-9ccb-dc59a9e9136f, 'http://apache.org', 1328129787427);
INSERT INTO Clicks (userid, url, time) VALUES
(d9c9dced-d539-4bce-9ccb-dc59a9e9136f, 'http://apache.org', 1328129787428);
INSERT INTO Clicks (userid, url, time) VALUES
(d9c9dced-d539-4bce-9ccb-dc59a9e9136f, 'http://apache.org', 1328129787429);
{noformat}
Because the PK is (userid, url), those lines are actually over-writing the same
column over and over again. Hence when the test do a select and expect 7 rows
in return, it only gets 2, but that's the right behavior (and as far as I can
tell, the IN work correctly in that test).
> Support query by names for compact CF
> -------------------------------------
>
> Key: CASSANDRA-3791
> URL: https://issues.apache.org/jira/browse/CASSANDRA-3791
> Project: Cassandra
> Issue Type: Sub-task
> Components: API
> Reporter: Sylvain Lebresne
> Assignee: Sylvain Lebresne
> Priority: Minor
> Labels: cql3
> Fix For: 1.1
>
> Attachments: 0001-Refactor-select.patch,
> 0002-Allow-IN-on-last-column-of-PRIMARY-KEY.patch
>
>
> Current code don't allow doing a query by names on wide rows (compact CF).
> I.e. with:
> {noformat}
> CREATE TABLE test1 (
> k int,
> c int,
> v int,
> PRIMARY KEY (k, c)
> ) WITH COMPACT STORAGE;
> {noformat}
> you cannot do:
> {noformat}
> SELECT v FROM test1 WHERE k = 0 AND c IN (5, 2, 8)
> {noformat}
> even though this is a simple name query.
> This ticket proposes to allow it.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira