incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard grossman <richie...@gmail.com>
Subject Get_slice with super column
Date Tue, 10 Nov 2009 19:41:25 GMT
hi

I insert data like this
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(dateAction);
    calendar.set(Calendar.MILLISECOND, 0);
    String millis = String.valueOf(calendar.getTimeInMillis());

        ColumnPath columnPath = new ColumnPath(columnFamily,
millis.getBytes("UTF-8"), ("showId").getBytes("UTF-8"));
        cassandraClient.insert("Keyspace1", userId, columnPath,
showId.getBytes("UTF-8"), timestamp, ConsistencyLevel.ONE);

        columnPath = new ColumnPath(columnFamily, millis.getBytes("UTF-8"),
("parentShowId").getBytes("UTF-8"));
        cassandraClient.insert("Keyspace1", userId, columnPath,
parentShowId.getBytes("UTF-8"), timestamp, ConsistencyLevel.ONE);

As you can see I use a datetime as super_column name.

I want to make get_slice to get only the showId field. I've tried to make
all the combination to get only this nothing help I get nothing.
like this
            col.add("showId".getBytes("UTF-8"));
            SlicePredicate predicateNegative = new SlicePredicate(col, new
SliceRange(new byte[0], new byte[0], false, 1000000));

or like this
            SlicePredicate predicateNegative = new SlicePredicate(null, new
SliceRange("showId".getBytes(), "showId".getBytes(), false, 1000000));

where is the problem ?

thanks

Mime
View raw message