cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandru Sicoe <adsi...@gmail.com>
Subject CQL select not working for CF defined programatically with Hector API
Date Mon, 03 Oct 2011 17:02:25 GMT
Hi,
 I am using Cassandra 0.8.5, Hector 0.8.0-2 and cqlsh (cql 1.0.3). If I
define a CF with comparator LongType like this:

        BasicColumnFamilyDefinition columnFamilyDefinition = new
BasicColumnFamilyDefinition();
        columnFamilyDefinition.setKeyspaceName("XXX");
        columnFamilyDefinition.setName("YYY");
        columnFamilyDefinition.setDefaultValidationClass(_BYTESTYPE);
        columnFamilyDefinition.setMemtableOperationsInMillions(0.1);
        columnFamilyDefinition.setMemtableThroughputInMb(40);
        columnFamilyDefinition.setComparatorType(ComparatorType.LONGTYPE);
        try {
            cluster.addColumnFamily(new
ThriftCfDef(columnFamilyDefinition));
        } catch(HectorException e) {
                throw e;
        }

Then I put some data in the CF.

The I try to do the following queries in cqlsh:

                          use XXX;
                          select * from YYY where KEY='aaa';

nothing is returned!

If I however do:
                          select * from YYY;

all the results are returned propperly!

So I have 2 questios:
1) Can I read with CQL if CFs were defined using the basic API? (the fact
that select * from YYY; works suggests that this is possible)
2) If yes, what is the correct query to use to read data with CQL? (I
suspect KEY is wrong...is there a default?)

Cheers,
Alex

Mime
View raw message