You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by michalsenkyr <gi...@git.apache.org> on 2017/05/16 23:45:03 UTC

[GitHub] spark pull request #18009: [SPARK-18891][SQL] Support for specific Java List...

GitHub user michalsenkyr opened a pull request:

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

    [SPARK-18891][SQL] Support for specific Java List subtypes

    ## What changes were proposed in this pull request?
    
    Add support for specific Java `List` subtypes in deserialization as well as a generic implicit encoder.
    
    All `List` subtypes are supported by using either the size-specifying constructor (one `int` parameter) or the default constructor.
    
    Interfaces/abstract classes use the following implementations:
    
    * `java.util.List`, `java.util.AbstractList` or `java.util.AbstractSequentialList` => `java.util.ArrayList`
    
    ## How was this patch tested?
    
    ```bash
    build/mvn -DskipTests clean package && dev/run-tests
    ```
    
    Additionally in Spark shell:
    
    ```
    scala> val jlist = new java.util.LinkedList[Int]; jlist.add(1)
    jlist: java.util.LinkedList[Int] = [1]
    res0: Boolean = true
    
    scala> Seq(jlist).toDS().map(_.element()).collect()
    res1: Array[Int] = Array(1)
    ```

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

    $ git pull https://github.com/michalsenkyr/spark dataset-java-lists

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

    https://github.com/apache/spark/pull/18009.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 #18009
    
----
commit 1cd6b6b4cdb0ff8a5cc42a105c7a8d4bc16fc0c1
Author: Michal Senkyr <mi...@gmail.com>
Date:   2017-04-16T15:54:40Z

    Add arbitrary Java List serialization/deserialization support

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

    https://github.com/apache/spark/pull/18009
  
    ok to test


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18009: [SPARK-18891][SQL] Support for specific Java List...

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/18009#discussion_r118209944
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala ---
    @@ -28,6 +28,8 @@ case class SeqClass(s: Seq[Int])
     
     case class ListClass(l: List[Int])
     
    +case class JListClass(l: java.util.List[Int])
    --- End diff --
    
    This is not supported intentionally. If we want to support java classes and scala classes mixedly, we should unify the `ScalaRelfection` and `JavaTypeInference`, which is a lot of effort.
    
    For now I think it's more important to completely support specific collections type in scala, and then try to unify the `ScalaRelfection` and `JavaTypeInference`.
    
    what do you think?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18009: [SPARK-18891][SQL] Support for specific Java List...

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/18009#discussion_r118210207
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala ---
    @@ -28,6 +28,8 @@ case class SeqClass(s: Seq[Int])
     
     case class ListClass(l: List[Int])
     
    +case class JListClass(l: java.util.List[Int])
    --- End diff --
    
    Alternatively you can improve `JavaTypeInference` to support specific java list and test it with java bean in `JavaDatasetSuite`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18009: [SPARK-18891][SQL] Support for specific Java List...

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

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

    https://github.com/apache/spark/pull/18009
  
    **[Test build #77879 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/77879/testReport)** for PR 18009 at commit [`881e636`](https://github.com/apache/spark/commit/881e6363ca6a8545e45f3e023f32762afd60943e).


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

    https://github.com/apache/spark/pull/18009
  
    ping @michalsenkyr 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18009: [SPARK-18891][SQL] Support for specific Java List...

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

    https://github.com/apache/spark/pull/18009#discussion_r121263319
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala ---
    @@ -28,6 +28,8 @@ case class SeqClass(s: Seq[Int])
     
     case class ListClass(l: List[Int])
     
    +case class JListClass(l: java.util.List[Int])
    --- End diff --
    
    I did not notice that there is separate inference code for Java classes. It would certainly be nice to unify the code for Java and Scala classes. Is this already being worked on/planned?
    
    I moved the `List` support to `JavaTypeInference` and rewrote tests accordingly.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark pull request #18009: [SPARK-18891][SQL] Support for specific Java List...

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/18009#discussion_r121265213
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala ---
    @@ -28,6 +28,8 @@ case class SeqClass(s: Seq[Int])
     
     case class ListClass(l: List[Int])
     
    +case class JListClass(l: java.util.List[Int])
    --- End diff --
    
    it's planned but no one is working on it yet. You can start by creating a JIRA ticket if you are interested :)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

    https://github.com/apache/spark/pull/18009
  
    LGTM, pending test


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


[GitHub] spark issue #18009: [SPARK-18891][SQL] Support for specific Java List subtyp...

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

    https://github.com/apache/spark/pull/18009
  
    Can one of the admins verify this patch?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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