apache-spark - How to convert RDD Structure
问题描述
How to convert
RDD[(String, (((A, B), C), D))]
to
RDD[(String, (A, B, C, D))]
Do I need to use flatMapValues
? I have no idea how to use it.
Can anybody help with this?
解决方案
You can just use mapValues
and select the values
from tuple as
rdd.mapValues(x => (x._1._1._1, x._1._1._2, x._1._2, x._2))
推荐阅读
- r - R中的数据表操作,以便可以轻松绘制变量图表
- apache-kafka-streams - 当消费者在一个组内时恢复 kafka 流
- javascript - 在 Next js / React 中保存和恢复窗口 y 位置
- apache-flink - 如何在纱线上的 flink 作业上配置 java home
- google-cloud-platform - 无法从不同项目中的机器映像创建 gcp 实例
- c++ - fmt::format 访问冲突
- c++ - 有没有一种安全的方法可以在子类控件上绘制一些额外的内容?
- amazon-web-services - AWS Terraform 向目标组注册目标时出错
- python - 如何使用 kivymd 上的按钮从列表小部件中删除项目
- java - Maven:项目 A 不尊重项目 B 的排除