sql(
"""
|SELECT short_group_id, store_id FROM tv_client_group
|WHERE last_group_update_time IS NULL
|""".stripMargin).agg(
array_join(collect_set(functions.concat($"store_id", expr("':' AS separator"), $"short_group_id")), ",").as("storeGroupIds"),
).where("storeGroupIds <> ''").map {
case Row(storeGroupIds: String) => {
storeGroupIds
}
}.collect()
SparkSql常用操作(updating)
最新推荐文章于 2025-01-06 17:00:00 发布
该博客主要涉及SQL查询,展示了如何从tv_client_group表中选取last_group_update_time为空的记录,通过聚合函数收集store_id与short_group_id,形成storeGroupIds集合。内容涵盖了数据库操作和数据处理的基本步骤,适合数据库管理和数据分析人员阅读。
7727

被折叠的 条评论
为什么被折叠?



