When I do select * from "TableToFetch" where column1='2js88saa-33oo-pzl7-b517-8584j2kf8wdd';
I get this error:
Bad Request: Invalid STRING constant (2js88saa-33oo-pzl7-b517-8584j2kf8wdd) for column1 of type timeuuid
These didn't help:
select * from "TableToFetch" where column1="2js88saa-33oo-pzl7-b517-8584j2kf8wdd";
returns
Bad Request: line 1:52 no viable alternative at input '2js88saa-33oo-pzl7-b517-8584j2kf8wdd'
select * from "TableToFetch" where column1=2js88saa-33oo-pzl7-b517-8584j2kf8wdd;
returns
Bad Request: TimeUUID supports only version 1 UUIDs
What do I do?
The first two errors is caused by the fact that you wrap your uuid with quotes: the first one gets interpreted as string, the second one does not get recognized as any type.
UUID and TimeUUID can/should be used in queries without any quotes.
The third error message is regarding the TimeUUID type, Apache Cassandra uses UUID of type 1, so it seems that 2js88saa-33oo-pzl7-b517-8584j2kf8wdd
is probably not a valid type 1 UUID. Your query seems to be ok, to me.
Also I am not sure how do you execute your query (cql or via driver) or what version of Cassandra do you use, but this answer might be relevant for you, too:
https://stackoverflow.com/a/17946236/9020666
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