我有一个sql查询,我想转换成spark-scala
SELECT aid,DId,BM,BY
FROM (SELECT DISTINCT aid,DId,BM,BY,TO FROM SU WHERE cd =2) t
GROUP BY aid,DId,BM,BY HAVING COUNT(*) >1;
字符串
SU是我的 Dataframe 。我是通过
sqlContext.sql("""
SELECT aid,DId,BM,BY
FROM (SELECT DISTINCT aid,DId,BM,BY,TO FROM SU WHERE cd =2) t
GROUP BY aid,DId,BM,BY HAVING COUNT(*) >1
""")
型
相反,我需要这个在利用我的 Dataframe
1条答案
按热度按时间vq8itlhq1#
这应该是DataFrame的等效项:
字符串