apache-spark - Dataset usage in "MapGroupsWithState" of Spark SQL
问题描述
I have events with "id and Map[String, List]"
data. I'm grouping these data by id
. Then I calculate somethings with "mapgroupswithstate".
Can I use from_json()
method in mapgroupswithstate
? So, can I use dataset/dataframe
in mapgroupswithstate
?
For example;
df.groupBy().mapgroupswithstate{
val anotherDF = events.toDF
... other operations...
}
解决方案
Can I use from_json() method in mapgroupswithstate? So, can I use dataset/dataframe in mapgroupswithstate?
Ans - Answer to both questions is No (loosely). Not in a standard way. When you are operating within mapgroupswithstate, then you are entering to executor level operations where you can write you custom code without dataframe abstraction.
推荐阅读
- android-accessibility - Android Accessibility 服务实时音频处理
- git - 推送到master时如何自动推送到子树?
- python - 如何在浏览器中查看 S3 存储桶视频文件
- angular - 角度更新后找不到渲染器和材质模块
- menuitem - 使用 Caliburn.Micro cal:Message.Attach 执行 No target found for method
- python - ValueError:检查目标时出错:预期dense_24有2维,但得到了形状为(16、10、1)的数组
- android - 如何在尊重 MVVM 架构的同时在 recyclerview 中的项目内提交单击事件?
- c - C 中的二进制补丁(而不是 xxd)
- python - Python:在绘制数据框值时,日期与非日期 xtickslabel 重叠
- javascript - 将 JSON 文件中的数据加载到 Handlebars / MJML 模板中