抛出java.lang.RuntimeException的Apache Spark SQL查询:[1.105]失败:预期的标识符

时间:2016-01-27 22:32:39

标签: sql apache-spark cassandra apache-spark-sql datastax-enterprise

我正在尝试使用Cassandra表上的SparkSQL执行以下嵌套查询

val x2=csc.sql("SELECT T.customer_id,T.category_id,T.supplier_id,T.tcount FROM retail.temp1recom1 T WHERE T.tcount IN ( SELECT t.tcount FROM retail.temp1recom1 t ORDER BY t.customer_id, t.tcount desc LIMIT 1 ) ORDER BY T.customer_id, T.tcount desc")

并且它抛出以下异常

java.lang.RuntimeException: [1.104] failure: identifier expected

SELECT T.customer_id,T.category_id,T.supplier_id,T.tcount FROM retail.temp1recom1 T WHERE T.tcount IN (SELECT t.tcount FROM retail.temp1recom1 t ORDER BY t.customer_id,t.tcount desc LIMIT 1) ORDER BY T.customer_id, T.tcountdesc                                                                                                       ^
    at scala.sys.package$.error(package.scala:27)
    at org.apache.spark.sql.catalyst.AbstractSparkSQLParser.parse(AbstractSparkSQLParser.scala:36)
...............
...............

不确定查询语法是否存在问题或与spark SQL有关 注意:该表已存在数据

阅读与该问题相关的一些帖子,但这与我的查询无关。需要帮助解决问题

0 个答案:

没有答案