码迷,mamicode.com
首页 > 数据库 > 详细

[Spark]What's the difference between spark.sql.shuffle.partitions and spark.default.parallelism?

时间:2018-10-30 12:09:31      阅读:350      评论:0      收藏:0      [点我收藏+]

标签:href   default   mat   work   spark   cal   .sql   enc   use   

From the answer here,

spark.sql.shuffle.partitions configures the number of partitions that are used when shuffling data for joins or aggregations.

spark.default.parallelism is the default number of partitions in RDDs returned by transformations like join, reduceByKey, and parallelize when not set explicitly by the user. Note that spark.default.parallelism seems to only be working for raw RDD and is ignored when working with dataframes.

If the task you are performing is not a join or aggregation and you are working with dataframes then setting these will not have any effect. You could, however, set the number of partitions yourself by calling df.repartition(numOfPartitions) (don‘t forget to assign it to a new val) in your code.

[Spark]What's the difference between spark.sql.shuffle.partitions and spark.default.parallelism?

标签:href   default   mat   work   spark   cal   .sql   enc   use   

原文地址:https://www.cnblogs.com/szss/p/9875914.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!