Niha3893382
Niha3893382

Reputation: 93

Cannot query based on TimeUUID in Spark SQL

I am trying to query the Cassandra database using SparkSQL terminal. Query:

select * from keyspace.tablename 
where user_id = e3a119e0-8744-11e5-a557-e789fe3b4cc1;

Error: java.lang.RuntimeException: [1.88] failure: ``union'' expected but identifier e5 found

Also tried:

user_id= UUID.fromString(\`e3a119e0-8744-11e5-a557-e789fe3b4cc1\`)")

user_id= \'e3a119e0-8744-11e5-a557-e789fe3b4cc1\'")

token(user_id)= token(`e3a119e0-8744-11e5-a557-e789fe3b4cc1`)

I am not sure how can I query data on timeuuid.

Upvotes: 0

Views: 489

Answers (1)

RussS
RussS

Reputation: 16576

TimeUUIDs are not supported as a type in SparkSQL so you are only allowed to do direct string comparisons. Represent the TIMEUUID as a string

select * from keyspace.tablename where user_id = "e3a119e0-8744-11e5-a557-e789fe3b4cc1"

Upvotes: 1

Related Questions