为什么 word2vec 在 Word2Vec.scala:323 处只为 mapPartitionsWithIndex 执行一项任务

Why does word2vec only take one task for mapPartitionsWithIndex at Word2Vec.scala:323

我是 运行 word2vec 在 spark 中,当谈到 fit() 时,在 UI 中只观察到一个任务,如图所示:

.

根据配置,num-executors = 1000, executor-cores = 2。 RDD 合并为 2000 个分区。 mapPartitionsWithIndex需要相当长的时间。能否分发给多个executor或task?

setNumPartitions(numPartitions: Int) 解决了我的问题。我没有检查默认值。 设置分区数(默认值:1)。