You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/05/03 08:21:19 UTC

[GitHub] [spark] zhengruifeng commented on pull request #36438: [SPARK-39092][SQL][WIP] Propagate Empty Partitions

zhengruifeng commented on PR #36438:
URL: https://github.com/apache/spark/pull/36438#issuecomment-1115847768

   a simplest case:
   
   ```
   
   spark.conf.set("spark.sql.adaptive.enabled", true)
   spark.conf.set("spark.sql.adaptive.skewJoin.enabled", true)
   spark.conf.set("spark.sql.autoBroadcastJoinThreshold", "-1")
   spark.conf.set("spark.sql.shuffle.partitions", 100)
   spark.conf.set("spark.sql.adaptive.coalescePartitions.enabled", false)
   
   
   
   val df1 = spark.range(0, 100000, 1, 7).selectExpr("id as key1", "id % 10 as value1")
   val df2 = spark.range(0, 100000, 1, 8).selectExpr("id % 30 as key2", "id as value2")
   val joined = df1.join(df2, col("key1") === col("key2"), "inner")
   
   
   
   spark.conf.set("spark.sql.adaptive.propagateEmptyPartitions.enabled", false)
   joined.write.mode("overwrite").parquet("/tmp/tmp1.parquet")
   
   
   
   spark.conf.set("spark.sql.adaptive.propagateEmptyPartitions.enabled", true)
   joined.write.mode("overwrite").parquet("/tmp/tmp2.parquet")
   
   ```
   
   
   ![image](https://user-images.githubusercontent.com/7322292/166423099-c0532c53-2f81-45f6-a10c-b2d7efadf002.png)
   
   
   existing impl:
   ![image](https://user-images.githubusercontent.com/7322292/166423290-56461013-a3a9-4996-abfd-684edfc262d6.png)
   
   
   after this PR:
   ![image](https://user-images.githubusercontent.com/7322292/166423379-097c48ef-9c24-426b-b312-76050ad135a4.png)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org