python - Pyspark:长过滤器链使驱动程序挂起
问题描述
假设我们有一个要构建过滤器链的谓词列表。当谓词列表超过 ~20 时,驱动程序就会挂起,并且作业永远不会出现在 spark ui 中。
例如:
df = spark.table('test.test')
for predicate in predicates_list:
positive_case = df.filter(predicate)
negative_case = df.filter(~predicate)
#some changes are made to negative and positive case
df = positive_case.union(negative_case)
df.show()
我能想到的唯一选择是将所有这些都写在一个 python 函数中,然后跳入 rdd 领域。然而,对于一个看似微不足道的问题,这似乎是一个非常老套的解决方案。
解决方案
推荐阅读
- javascript - 如何停止 Node.JS 通知流?
- python - Thread.join() 在 python 中到底做了什么?这是对 Thread.join() 的错误使用吗?
- animation - Aframe-animation-component direction: alternate bug
- python-3.x - python requests login with captcha
- sql-server - Oracle 的 SQL Server 数据类型 - 数字 (13, 12)
- python-3.x - python将lambda从更少的行应用到不同数据帧中的更多行
- python - 在随时间变化的范围内生成随机值
- mysql - 高级 SQL 选择查询/动态列
- html - 透明导航栏 css
- python - 从列表元素构造元组的最快方法(Python)