当前位置:网站首页>Spark SQL gets the element at an index of the array
Spark SQL gets the element at an index of the array
2022-04-22 08:33:00 【Amnesia】
index from 1 Start
val df = Seq(
("a", "b")
, ("a", "c")
, ("a", "d")
).toDF("c1", "c2")
val df1 = df.groupBy('c1).agg(collect_list(struct($"c1", $"c2")).as("c3"))
df1.show(false)
df1.select(element_at($"c3",1)).show()
spark.stop()

版权声明
本文为[Amnesia]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220726326715.html
边栏推荐
- 用OnLayoutChangeListener的方法解决getTop=0的问题
- 指针和数组(操作详解)
- centos7安装MySQL8.0
- 7-34 delete duplicate characters (set usage) & 7-35 count the number of characters (unordered_map)
- C的动态内存管理
- Flutter GridView Demo
- Arm bare metal (IV) -- exceptions and interrupts
- 1315. 祖父节点值为偶数的节点和(Medium)
- 129. 求根节点到叶节点数字之和(Medium)
- SQL requirements processing - count the number of Mondays to Sundays in a given year
猜你喜欢
随机推荐
Probability theory note 6.3 sampling distribution
Mapbox设置官方地图语言为中文
centos7安装MySQL8.0
SmartTabLayout 简介
Viewpager comprehensive summary
Make the airtest ide into a script and make the script run
Redefine China's "core"
cesium实现建筑物单体化(分栋分层)
构造函数与toString
Winsock编程接口实验:实现ping
cesium 采集地形高度,采集模型高度 (异步方法,适合数据较多的时候)
eventBus
shell脚本学习笔记——shell对文件的操作sed
Cloud computing learning 2 - keystone component operation and maintenance and testing
手把手教你实现RecyclerView的下拉刷新和上拉加载更多
shell监控IBM MQ队列深度,10s扫描三次,有两次以上深度值超过5时,则输出队列名称和深度值。
Experiment 2: mathematical basis in Data Science
Flutter Modul类与Json相互转换
面试题 04.03. 特定深度节点链表(Medium)
sql需求处理篇-统计指定某年中有多少个周一至周日









