I face a problem inserting some number values into column family with composite column (Cassandra 1.1.6 using Astyanax 1.0.6 client).
AnnotatedCompositeSerializer<DailyPersonal> dailyPersonalSerializer
= new AnnotatedCompositeSerializer<DailyPersonal>(DailyPersonal.class);
ColumnFamily<Long, DailyPersonal> CF_DAILY_PERSONAL
= new ColumnFamily<Long, DailyPersonal>("daily_personal",
LongSerializer.get(), dailyPersonalSerializer);
DailyPersonal dailyPersonalSteps = new DailyPersonal(new LocalDate(2012, 1, 1).toDate(), 12348L, "steps");
DailyPersonal dailyPersonalDistance = new DailyPersonal(new LocalDate(2012, 1, 1).toDate(), 12348L, "distance");
MutationBatch m = keyspace.prepareMutationBatch();
m.withRow(CF_DAILY_PERSONAL, 1L)
.putColumn(dailyPersonalSteps, 333, null)
;
m.withRow(CF_DAILY_PERSONAL, 1L)
.putColumn(dailyPersonalDistance, 444, null)
;
DailyPersonal is defined as:
public class DailyPersonal {
@Component(ordinal = 0)
private Date logDate;
@Component(ordinal = 1)
private Long userId;
@Component(ordinal = 2)
private String field;
...
}
Column family definition:
CREATE TABLE daily_personal (
program_id bigint,
log_date timestamp,
user_id bigint,
distance int,
steps int,
PRIMARY KEY (program_id, log_date, user_id)
);
The problem arises during inserting some values: i.e. 444 fails, while 333 works fine. I can't figure the dependency, but looks like it fails for a lot of values [0; 1500]. Error message looks like:
com.netflix.astyanax.connectionpool.exceptions.BadRequestException: BadRequestException: [host=127.0.0.1(127.0.0.1):9160, latency=19(40), attempts=1] InvalidRequestException(why:(String didn't validate.) [demodb][daily_personal][2012-01-01 00:00:00+0300:12348:distance] failed validation)
I do not see any obvious reasons why it fails. Could someone tell if my code is correct or there any environment/libraries issue?