spark中分区是如何产生的

spark中的partition可以通过api来设置,如果不设置的会,系统会自动分区吗?分区的逻辑是什么?按照block,每个block来设置一个分区?
有没有人啊- -。

阅读 3.3k
3 个回答

"Normally, Spark tries to set the number of partitions automatically based on your cluster. However, you can also set it manually by passing it as a second parameter to parallelize"文档是这么说的.

如果是HDFS读出来,一个block就是一个分区。如果从kafka读,一个kafka Partition就是一个分区……

新手上路,请多包涵

会根据你的电脑的cpu核数自动分配

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进