Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5497#discussion_r28283271
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/Exchange.scala ---
    @@ -45,6 +46,27 @@ case class Exchange(newPartitioning: Partitioning, 
child: SparkPlan) extends Una
       private val bypassMergeThreshold =
         
child.sqlContext.sparkContext.conf.getInt("spark.shuffle.sort.bypassMergeThreshold",
 200)
     
    +  def serializer(
    +      keySchema: Array[DataType],
    +      valueSchema: Array[DataType],
    +      numPartitions: Int): Serializer = {
    +    val useSqlSerializer2 =
    +      !(sortBasedShuffleOn && numPartitions > bypassMergeThreshold) &&
    +      child.sqlContext.conf.useSqlSerializer2 &&
    +      SparkSqlSerializer2.support(keySchema) &&
    +      SparkSqlSerializer2.support(valueSchema)
    +
    +    val serializer = if (useSqlSerializer2) {
    +      logInfo("Use ShuffleSerializer")
    +      new SparkSqlSerializer2(keySchema, valueSchema)
    +    } else {
    +      logInfo("Use SparkSqlSerializer")
    +      new SparkSqlSerializer(new SparkConf(false))
    +    }
    +
    +    serializer
    +  }
    +
    --- End diff --
    
    Rewrite the `Exchange.toString` to print the `serializer` also, which will 
provide more sophisticated information for troubleshooting. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to