我正在尝试使用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有关 注意:该表已存在数据
阅读与该问题相关的一些帖子,但这与我的查询无关。需要帮助解决问题