How to execute a spark sql query from a map function (Python)?

孤街醉人 提交于 2019-12-04 16:28:47

One does not execute nested operations on distributed data structure.It is simply not supported in Spark. You have to use joins, local (optionally broadcasted) data structures or access external data directly instead.

In case when you can't accomplish your task with the joins and want to run the SQL queries in memory:

You can consider using some in-memory database like H2, Apache Derby and Redis etc. to execute parallel faster SQL queries without loosing benefits of in-memory computation.

In-memory databases will provide faster access as compared to MySQL, PostgreSQL etc. databases.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!