What is the Java API for using maxTimeuuid and minTimeuuid based queries? I could not find any in the QueryBuilder or anywhere else. I am using DataStax client
<artifactId>cassandra-driver-core</artifactId>
<version>1.0.3</version>
Table "a" has 2 columns: 1. id of type String 2. LMD of type TimeUuid
This is what I am doing and does not seem right and of course does not work
Query q = QueryBuilder
.select()
.all()
.from("test","a")
.where().and(QueryBuilder.gt("LMD", "minTimeUUid('2013-11-03 14:33:50')"))
.and(QueryBuilder.lt("LMD", "maxTimeUUId('2013-11-03 14:45:50')"));
Any pointers are highly appreciated
Thanks
You will need to generate the max/min TimeUUIDs programatically, from timestamps using the utils.UUIDs utility class, e.g.
final UUID min = UUIDs.startOf(lowerTimeStamp);
final UUID max = UUIDs.endOf(upperTimeStamp);
Query q = QueryBuilder
.select()
.all()
.from("test","a")
.where(QueryBuilder.gt("LMD", min))
.and(QueryBuilder.lt("LMD", max));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With