kallaspriit / Cassandra-PHP-Client-Library

Cassandra PHP-based client library for managing and querying your Cassandra cluster
http://cassandra-php-client-library.com
103 stars 25 forks source link

integer type column - secondary key - Not Working for Integer but Works for Long #32

Open ghost opened 11 years ago

ghost commented 11 years ago
    array(
        'name' => 'zipcode',
        'type' => Cassandra::TYPE_LONG,
        'index-type' => Cassandra::INDEX_KEYS 
    ),
    array(
        'name' => 'rating1to10',
        'type' => Cassandra::TYPE_INTEGER,
        'index-type' => Cassandra::INDEX_KEYS
    )

In the above code, when I apply WHERE condition on a SELECT as shown below you can see it returns 0 rows. If I set the secondary key in cqlsh it WORKS.

cqlsh:befit> SELECT * FROM USER WHERE zipcode=75063;

key | email | name | rating1to10 | userid | zipcode ------------+----------------+------------+-------------+--------+--------- 0x6a6f686e | john@smith.com | John Smith | 34 | john | 75063

(1 rows)

cqlsh:befit> SELECT * FROM USER WHERE rating1to10=34;

(0 rows)

Please advise. Thank you