Hi,

I see strange behaviour using CF with two secondary indexes, one
IntegerType one UTF8Type.

Using Cassanra 1.0.9 and CF:

create column family IndexTest
    with column_type=Standard
    and comparator=UTF8Type
    and default_validation_class=UTF8Type
    and key_validation_class=UTF8Type
    and column_metadata=
    [{
        column_name: col1,
        validation_class: UTF8Type,
        index_type: KEYS
    },
    {
        column_name: col2,
        validation_class: IntegerType,
        index_type: KEYS
    }];

There are 13 928 437 rows. Col1 and col2 are created in MapReduce job
from other columns. The MapReruce job is used for recreating the index
columns. The col1 secondary index works the col2 behaves strangely.
Sometimes it returns correct result, sometimes nothing like in
following example.

[default@rfTest3] get IndexTest where col1 =
'3230727:http://zaskolak.cz/download.php';
-------------------
RowKey: 3230727:8383582:http://zaskolak.cz/download.php
=> (column=col1, value=3230727:http://zaskolak.cz/download.php,
timestamp=1335348630332000)
=> (column=col2, value=8383582, timestamp=1335348630332000)
-------------------
RowKey: 3230727:8383583:http://zaskolak.cz/download.php
=> (column=col1, value=3230727:http://zaskolak.cz/download.php,
timestamp=1335348449078000)
=> (column=col2, value=8383583, timestamp=1335348449078000)
-------------------
RowKey: 3230727:8383579:http://zaskolak.cz/download.php
=> (column=col1, value=3230727:http://zaskolak.cz/download.php,
timestamp=1335348778577000)
=> (column=col2, value=8383579, timestamp=1335348778577000)

3 Rows Returned.
Elapsed time: 292 msec(s).
[default@rfTest3] get IndexTest where col2 = 8383583;

0 Row Returned.
Elapsed time: 7 msec(s


The col2 value is written from MapReduce like this 'ByteBufferUtil.bytes(Id)'.

What can be the problem here?

Regards,
P.

Reply via email to