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/11/26 09:16:06 UTC

[GitHub] spark pull request #23143: [SPARK-24762][SQL][Followup] Enable Option of Pro...

GitHub user viirya opened a pull request:

    https://github.com/apache/spark/pull/23143

    [SPARK-24762][SQL][Followup] Enable Option of Product encoders

    ## What changes were proposed in this pull request?
    
    This is follow-up of #21732. This patch inlines `isOptionType` method.
    
    ## How was this patch tested?
    
    Existing tests.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/viirya/spark-1 SPARK-24762-followup

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/23143.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #23143
    
----
commit f6bfe3d66774c5b8a61123dd79d4d3d49464df5f
Author: Liang-Chi Hsieh <vi...@...>
Date:   2018-11-26T09:09:27Z

    Inline isOptionType.

----


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    **[Test build #99277 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/99277/testReport)** for PR 23143 at commit [`f3f0507`](https://github.com/apache/spark/commit/f3f0507f6797c571ce66086d9e3b7fcbfd234c79).


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    thanks, merging to master!


---

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


[GitHub] spark pull request #23143: [SPARK-24762][SQL][Followup] Enable Option of Pro...

Posted by cloud-fan <gi...@git.apache.org>.
Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23143#discussion_r236267692
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala ---
    @@ -251,19 +251,15 @@ case class ExpressionEncoder[T](
        */
       def isSerializedAsStruct: Boolean = objSerializer.dataType.isInstanceOf[StructType]
     
    -  /**
    -   * Returns true if the type `T` is an `Option` type.
    -   */
    -  def isOptionType: Boolean = classOf[Option[_]].isAssignableFrom(clsTag.runtimeClass)
    -
       /**
        * If the type `T` is serialized as a struct, when it is encoded to a Spark SQL row, fields in
        * the struct are naturally mapped to top-level columns in a row. In other words, the serialized
        * struct is flattened to row. But in case of the `T` is also an `Option` type, it can't be
        * flattened to top-level row, because in Spark SQL top-level row can't be null. This method
        * returns true if `T` is serialized as struct and is not `Option` type.
        */
    -  def isSerializedAsStructForTopLevel: Boolean = isSerializedAsStruct && !isOptionType
    +  def isSerializedAsStructForTopLevel: Boolean = isSerializedAsStruct &&
    --- End diff --
    
    nit: since it cross lines, I'd prefer
    ```
    def xxx = {
      xxx
    }
    ```


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/5356/
    Test PASSed.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/99277/
    Test PASSed.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    **[Test build #99273 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/99273/testReport)** for PR 23143 at commit [`f6bfe3d`](https://github.com/apache/spark/commit/f6bfe3d66774c5b8a61123dd79d4d3d49464df5f).


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    cc @cloud-fan 


---

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


[GitHub] spark pull request #23143: [SPARK-24762][SQL][Followup] Enable Option of Pro...

Posted by viirya <gi...@git.apache.org>.
Github user viirya commented on a diff in the pull request:

    https://github.com/apache/spark/pull/23143#discussion_r236295606
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoder.scala ---
    @@ -251,19 +251,15 @@ case class ExpressionEncoder[T](
        */
       def isSerializedAsStruct: Boolean = objSerializer.dataType.isInstanceOf[StructType]
     
    -  /**
    -   * Returns true if the type `T` is an `Option` type.
    -   */
    -  def isOptionType: Boolean = classOf[Option[_]].isAssignableFrom(clsTag.runtimeClass)
    -
       /**
        * If the type `T` is serialized as a struct, when it is encoded to a Spark SQL row, fields in
        * the struct are naturally mapped to top-level columns in a row. In other words, the serialized
        * struct is flattened to row. But in case of the `T` is also an `Option` type, it can't be
        * flattened to top-level row, because in Spark SQL top-level row can't be null. This method
        * returns true if `T` is serialized as struct and is not `Option` type.
        */
    -  def isSerializedAsStructForTopLevel: Boolean = isSerializedAsStruct && !isOptionType
    +  def isSerializedAsStructForTopLevel: Boolean = isSerializedAsStruct &&
    --- End diff --
    
    ok. fixed.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    **[Test build #99277 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/99277/testReport)** for PR 23143 at commit [`f3f0507`](https://github.com/apache/spark/commit/f3f0507f6797c571ce66086d9e3b7fcbfd234c79).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    **[Test build #99273 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/99273/testReport)** for PR 23143 at commit [`f6bfe3d`](https://github.com/apache/spark/commit/f6bfe3d66774c5b8a61123dd79d4d3d49464df5f).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---

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


[GitHub] spark pull request #23143: [SPARK-24762][SQL][Followup] Enable Option of Pro...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/23143


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    Merged build finished. Test PASSed.


---

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


[GitHub] spark issue #23143: [SPARK-24762][SQL][Followup] Enable Option of Product en...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/23143
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/testing-k8s-prb-make-spark-distribution-unified/5360/
    Test PASSed.


---

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