[英]Limiting number of collect_list items in spark scala
I have code that states我有代码说明
db.groupBy("ids")
.agg(collect_list("names") as "alias")
.select("ids", "alias")
However, there are some rows where the alias would be only 1 entry large, while others could be 200.但是,有些行的别名只有 1 个条目大,而其他可能是 200 个条目。
How can I limit the ones with >30 entries to a maximum of 30 entries?如何将 > 30 个条目的条目限制为最多 30 个条目?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.