Java spark sql问题:第一个匹配行上的联接表:rank()不工作

Java spark sql问题:第一个匹配行上的联接表:rank()不工作,java,apache-spark,apache-spark-sql,spark-dataframe,Java,Apache Spark,Apache Spark Sql,Spark Dataframe,我必须使用spark java API编写以下查询 select * from ( select u.*, RANK() OVER (PARTITION BY u.imsi,u.[uplink_ip_string] ORDER BY u.uplink_start ASC) AS [RANK1] , from uplinkonly u,downlinkonly d where u.imsi=d.imsi and u.[uplink_ip_string]=d.[uplink_ip_string] a

我必须使用spark java API编写以下查询

select * from (
select u.*,
RANK() OVER (PARTITION BY u.imsi,u.[uplink_ip_string] ORDER BY u.uplink_start ASC) AS [RANK1] ,
from uplinkonly u,downlinkonly d
where u.imsi=d.imsi
and u.[uplink_ip_string]=d.[uplink_ip_string]
and u.[downlink_port]=d.downlink_port
and d.downlink_start!='0'
and (cast(u.uplink_start as bigint) -cast(d.downlink_start as bigint))< 25000
and (cast(u.uplink_start as bigint) -cast(d.downlink_start as bigint))>-25000
)a  where  RANK1=1"
我可以使用哪些其他选项来获得所需的输出


我可以通过迭代两个RDD来实现它吗?一个用于上行链路,另一个用于下行链路?

错误说明了所有问题,我相信我以前已经回答过类似的问题。有没有其他方法可以实现queryWell中的排名功能?错误说明了所有问题,我相信我以前已经回答过类似的问题。有没有另外,我可以在查询中实现排名功能
"Could not resolve window function 'rank'. Note that, using window functions currently requires a Hive Context"