在Spark SQL中无法基于TimeUUID进行查询 [英] Cannot query based on TimeUUID in Spark SQL

查看:351
本文介绍了在Spark SQL中无法基于TimeUUID进行查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用SparkSQL终端查询Cassandra数据库。
查询:

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




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


也尝试过:

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

user_id = \'e3a119e0-8744-











$ e $ pre>

我不知道如何查询 timeuuid 上的数据。

解决方案

TimeUUID不支持作为SparkSQL中的类型,所以你只能进行直接字符串比较。以字符串形式表示TIMEUUID

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


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.

解决方案

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"

这篇关于在Spark SQL中无法基于TimeUUID进行查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆