【发布时间】:2021-04-04 13:05:18
【问题描述】:
我的 df 中有以下两列。我想过滤这些列,使过滤后的结果 df 应该像下面的结果 df。
输入表
| col1 | col2 |
|---|---|
| null | Approved |
| FALSE | null |
| null | null |
| FALSE | Approved |
| TRUE | null |
| null | new |
| FALSE | Declined |
| FALSE | new |
过滤后的输出结果表
| col1 | col2 |
|---|---|
| null | Approved |
| null | null |
| **FALSE | Approved** |
| TRUE | null |
| null | new |
逻辑 - 如果 col1 为 False,则 col2 应获得批准,或者 col1 不应等于 FALSE。
【问题讨论】:
标签: apache-spark pyspark apache-spark-sql