cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-8421) Cassandra 2.1.1 & Cassandra 2.1.2 UDT not returning value for LIST type as UDT
Date Fri, 16 Jan 2015 15:03:35 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-8421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14280339#comment-14280339
] 

Benjamin Lerer commented on CASSANDRA-8421:
-------------------------------------------

It seems that there are 2 issues:

* When retrieving the partition keys from the index they appear to not be in the correct order.
If they have been inserted with a unit tests they are returned in the correct order but not
if they have been inserted manually. This could means that the problem has occured during
the index compaction. 

This problem is probably responsible for the fact that we had some trouble to reproduce the
issue with some unit tests.

* The second problem is that if a record is filtered out within {{CompositesSearcher}} for
a collection value index all the following records with the same prefix will be rejected.

The second part of the problem can be reproduced with the following modified version of the
{{testOneIndex}} unit test:
{code}
    @Test
    public void testOneIndex() throws Throwable
    {
        String fieldmap = createType("CREATE TYPE %s (key text, value text)");
        createTable("CREATE TABLE %s (e int PRIMARY KEY, b int, f list<frozen<" + fieldmap
+ ">>, s int)");
        createIndex("CREATE INDEX ON %s(f)");
        for(int i = 0; i < 17; i++)
        {
            execute("INSERT INTO %s (e, b, f, s) VALUES (?, ?, [{key: 'state', value: 'Dubai'}],
?)", i, i+1, 4);
        }
        for(int i = 17; i < 20; i++)
        {
            execute("INSERT INTO %s (e, b, f, s) VALUES (?, ?, [{key: 'state', value: 'Dubai'}],
?)", i, i+1, 3);
        }
        UntypedResultSet resultSet = execute("SELECT * FROM %s WHERE f CONTAINS {key: 'state',
value: 'Dubai'} AND s=3 allow filtering");
        Assert.assertEquals(3, resultSet.size());
    }
{code}

> Cassandra 2.1.1 & Cassandra 2.1.2 UDT not returning value for LIST type as UDT
> ------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8421
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8421
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>         Environment: single node cassandra 
>            Reporter: madheswaran
>            Assignee: Benjamin Lerer
>             Fix For: 3.0, 2.1.3
>
>         Attachments: 8421-unittest.txt, entity_data.csv
>
>
> I using List and its data type is UDT.
> UDT:
> {code}
> CREATE TYPE
> fieldmap (
>  key text,
>  value text
> );
> {code}
> TABLE:
> {code}
> CREATE TABLE entity (
>   entity_id uuid PRIMARY KEY,
>   begining int,
>   domain text,
>   domain_type text,
>   entity_template_name text,
>   field_values list<fieldmap>,
>   global_entity_type text,
>   revision_time timeuuid,
>   status_key int,
>   status_name text,
>   uuid timeuuid
>   ) {code}
> INDEX:
> {code}
> CREATE INDEX entity_domain_idx_1 ON galaxy_dev.entity (domain);
> CREATE INDEX entity_field_values_idx_1 ON galaxy_dev.entity (field_values);
> CREATE INDEX entity_global_entity_type_idx_1 ON galaxy_dev.entity (gen_type );
> {code}
> QUERY
> {code}
> SELECT * FROM entity WHERE status_key < 3 and field_values contains {key: 'userName',
value: 'Sprint5_200002'} and gen_type = 'USER' and domain = 'S4_1017.abc.com' allow filtering;
> {code}
> The above query return value for some row and not for many rows but those rows and data's
are exist.
> Observation:
> If I execute query with other than field_maps, then it returns value. I suspect the problem
with LIST with UDT.
> I have single node cassadra DB. Please let me know why this strange behavior from cassandra.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message