You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by viirya <gi...@git.apache.org> on 2018/08/10 04:58:51 UTC

[GitHub] spark pull request #21732: [SPARK-24762][SQL] Enable Option of Product encod...

Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21732#discussion_r209144900
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala ---
    @@ -43,20 +43,17 @@ import org.apache.spark.util.Utils
      *    to the name `value`.
      */
     object ExpressionEncoder {
    -  def apply[T : TypeTag](): ExpressionEncoder[T] = {
    +  // Constructs an encoder for top-level row.
    +  def apply[T : TypeTag](): ExpressionEncoder[T] = apply(topLevel = true)
    +
    +  /**
    +   * @param topLevel whether the encoders to construct are for top-level row.
    +   */
    +  def apply[T : TypeTag](topLevel: Boolean): ExpressionEncoder[T] = {
    --- End diff --
    
    In `Aggregator`, we can call this apply with `topLevel = false` to avoid resulting a nested struct.


---

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