I am writing a parameterized CQL statement that is not behaving as I would expect. I am trying to return a list of records for a range of dates that in this instance are using the same date for the beginning and end points.
The table is defined as follows:
CREATE TABLE sometable (
partition_key varchar,
cluster_start_date timestamp,
other_cluster_key varchar,
data varchar,
PRIMARY KEY((partition_key), cluster_start_date, other_cluster_key)
) WITH CLUSTERING ORDER BY(cluster_start_date ASC, other_cluster_key ASC);
The prepared statement is as follows:
SELECT * FROM sometable WHERE partition_key = 'xxx' AND cluster_start_date >= ? AND cluster_start_date <= ?;
When the parameterized dates are different, the statement returns the correct data. But when the parameterized dates are the same, then no values are returned.
Could someone tell me why this statement does not work with identical parameters, and if so, what can be done to get the expected behavior?
Thanks for all who can help....