我正在运行 PySpark 作业,并且收到以下消息:
WARN org.apache.spark.sql.execution.Window: No Partition Defined for Window operation! Moving all data to a single partition, this can cause serious performance degradation.
该消息表示什么,以及如何为 Window 操作定义分区?
编辑:
我正在尝试对整个列进行排名。
我的数据组织为:
A
B
A
C
D
而且我要:
A,1
B,3
A,1
C,4
D,5
我认为不应该为此使用 .partitionBy(),只有 .orderBy()。问题是,这似乎会导致性能下降。有没有另一种方法可以在没有 Window 功能的情况下实现这一目标?
如果我按第一列分区,结果将是:
A,1
B,1
A,1
C,1
D,1
这是我不想要的。