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 2015/12/19 09:40:25 UTC

[GitHub] spark pull request: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

GitHub user viirya opened a pull request:

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

    [SPARK-12438][SQL] Add SQLUserDefinedType support for encoder

    JIRA: https://issues.apache.org/jira/browse/SPARK-12438
    
    ScalaReflection lacks the support of SQLUserDefinedType. We should add it.


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

    $ git pull https://github.com/viirya/spark-1 encoder-udt

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

    https://github.com/apache/spark/pull/10390.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 #10390
    
----
commit 089ab18dd03dde6a4fd6bd787b1bd3674f394ca7
Author: Liang-Chi Hsieh <vi...@gmail.com>
Date:   2015-12-19T08:27:35Z

    Add SQLUserDefinedType support for encoder.

commit 51b76b163a95de571d01473a24fda7773db57498
Author: Liang-Chi Hsieh <vi...@gmail.com>
Date:   2015-12-19T08:39:19Z

    Add assert.

----


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48780378
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala ---
    @@ -242,6 +242,16 @@ class ExpressionEncoderSuite extends SparkFunSuite {
         ExpressionEncoder.tuple(intEnc, ExpressionEncoder.tuple(intEnc, longEnc))
       }
     
    +  test("user type with ScalaReflection") {
    +    val point = (new ExamplePoint(0.1, 0.2), new ExamplePoint(0.3, 0.4))
    +    val schema = ScalaReflection.schemaFor[Tuple2[ExamplePoint, ExamplePoint]]
    +      .dataType.asInstanceOf[StructType]
    +    val attributeSeq = schema.toAttributes
    +    val boundEncoder = encoderFor[Tuple2[ExamplePoint, ExamplePoint]]
    +      .resolve(attributeSeq, outers).bind(attributeSeq)
    +    assert(boundEncoder.fromRow(boundEncoder.toRow(point)) === point)
    +  }
    --- End diff --
    
    Just make this `productTest(("UDT", new ExamplePoint(0.1, 0.2)))`.  It always better to reuse existing infrastructure when possible.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168165278
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48548/
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

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


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168877970
  
    **[Test build #48721 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48721/consoleFull)** for PR 10390 at commit [`80a3f7b`](https://github.com/apache/spark/commit/80a3f7b56f14eeb1b7c3d84cc2544458d9de13cd).


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/10390#issuecomment-168050667
  
    Do you mean just the example UDT `MyLabeledPoint`?  I'm fine with duplicating that or moving it entirely.  If UDTs are defined in catalyst we should also have unit tests for them there.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168113152
  
    @marmbrus Not only MyLabeledPoint, which is just a case class. Also including UDT MyDenseVectorUDT and MyDenseVector. I think it might duplicate too many lines of codes from UserDefinedTypeSuite to encoder test suite like ExpressionEncoderSuite.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-167960014
  
    **[Test build #48468 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48468/consoleFull)** for PR 10390 at commit [`42303d2`](https://github.com/apache/spark/commit/42303d25fe6e85d65644e45e7d4b600f0041a1f2).


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48807733
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala ---
    @@ -94,6 +99,9 @@ class UserDefinedTypeSuite extends QueryTest with SharedSQLContext with ParquetT
         assert(featuresArrays.contains(new MyDenseVector(Array(0.2, 2.0))))
       }
     
    +  private val outers: ConcurrentMap[String, AnyRef] = new MapMaker().weakValues().makeMap()
    +  outers.put(getClass.getName, this)
    +
    --- End diff --
    
    Forgot to remove them.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168900177
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48721/
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168150645
  
    **[Test build #48547 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48547/consoleFull)** for PR 10390 at commit [`72446f1`](https://github.com/apache/spark/commit/72446f15ca26f2ea0570d01368756fed759a89fb).
     * This patch **fails to build**.
     * 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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-165975417
  
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/10390#issuecomment-166403465
  
    I think we need more design work before we implement this.  I'm not a huge fan of the current UDT API and I think we will replace it in Spark 2.0.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-167975181
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48468/
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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/10390#discussion_r48113653
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala ---
    @@ -89,6 +94,23 @@ class UserDefinedTypeSuite extends QueryTest with SharedSQLContext with ParquetT
         assert(featuresArrays.contains(new MyDenseVector(Array(0.2, 2.0))))
       }
     
    +  test("user type with ScalaReflection") {
    +    val points = Seq(
    +      MyLabeledPoint(1.0, new MyDenseVector(Array(0.1, 1.0))),
    +      MyLabeledPoint(0.0, new MyDenseVector(Array(0.2, 2.0))))
    +
    +    val schema = ScalaReflection.schemaFor[MyLabeledPoint].dataType.asInstanceOf[StructType]
    +    val attributeSeq = schema.toAttributes
    +
    +    val pointEncoder = encoderFor[MyLabeledPoint]
    +    val unsafeRows = points.map(pointEncoder.toRow(_).copy())
    --- End diff --
    
    can we also test `encoder.fromRow`?
    
    we can just create a `MyLabelPoint` and encode it to `InternalRow` and decode it back by encoder, and check if the decoded `MyLabelPoint` is same with the original one.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166226967
  
    **[Test build #48100 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48100/consoleFull)** for PR 10390 at commit [`d01c661`](https://github.com/apache/spark/commit/d01c661c0cf2157a90b6c732b70309f1aa2f3ccd).


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168150125
  
    **[Test build #48547 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48547/consoleFull)** for PR 10390 at commit [`72446f1`](https://github.com/apache/spark/commit/72446f15ca26f2ea0570d01368756fed759a89fb).


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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/10390#discussion_r48123608
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -81,6 +81,9 @@ object Cast {
                     toField.nullable)
             }
     
    +    case (udt1: UserDefinedType[_], udt2: UserDefinedType[_]) if udt1.userClass == udt2.userClass =>
    --- End diff --
    
    I think this worth another JIRA.
    
    Is `ScalaRelfection` the only place that may use UDT in `Cast`?


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168165009
  
    **[Test build #48548 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48548/consoleFull)** for PR 10390 at commit [`62fa738`](https://github.com/apache/spark/commit/62fa738dca9e7848156772ec99d5f956622321d9).
     * 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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-165975421
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48050/
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168900175
  
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-167975129
  
    **[Test build #48468 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48468/consoleFull)** for PR 10390 at commit [`42303d2`](https://github.com/apache/spark/commit/42303d25fe6e85d65644e45e7d4b600f0041a1f2).
     * 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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168165273
  
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168150652
  
    Merged build finished. Test FAILed.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48125827
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -81,6 +81,9 @@ object Cast {
                     toField.nullable)
             }
     
    +    case (udt1: UserDefinedType[_], udt2: UserDefinedType[_]) if udt1.userClass == udt2.userClass =>
    --- End diff --
    
    I think so, as it is a special use case. I will open another JIRA for it.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168127250
  
    We alread have UDT in [`RowEncoderSuite`](https://github.com/apache/spark/blob/master/sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/RowEncoderSuite.scala#L28-L76), can we move it to a seperate file, and share it within catalyst tests?


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166181434
  
    cc @cloud-fan @marmbrus @davies 


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/10390#issuecomment-169087339
  
    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 pull request: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166473725
  
    Personally, I would like to see this to be merged because it blocks my another PR #10283. Can we merge this and go back to modify this part when we revamp UDT API in the future? But of course it depends on you. Thanks.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166245642
  
    **[Test build #48100 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48100/consoleFull)** for PR 10390 at commit [`d01c661`](https://github.com/apache/spark/commit/d01c661c0cf2157a90b6c732b70309f1aa2f3ccd).
     * 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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/10390#issuecomment-167648261
  
    Okay, I'm fine with merging this now to unblock other progress.  However, I think we should move the test to be with the other encoder tests.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48780302
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala ---
    @@ -94,6 +99,9 @@ class UserDefinedTypeSuite extends QueryTest with SharedSQLContext with ParquetT
         assert(featuresArrays.contains(new MyDenseVector(Array(0.2, 2.0))))
       }
     
    +  private val outers: ConcurrentMap[String, AnyRef] = new MapMaker().weakValues().makeMap()
    +  outers.put(getClass.getName, this)
    +
    --- End diff --
    
    These changes are not needed.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

Posted by marmbrus <gi...@git.apache.org>.
Github user marmbrus commented on the pull request:

    https://github.com/apache/spark/pull/10390#issuecomment-166445780
  
    We can revisit this if we do a 1.7 release, but I don't think that is going to happen.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168127437
  
    @cloud-fan I just think the same thing. I will try it.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166445480
  
    That is fine. But we will leave it broken until Spark2.0?


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168153873
  
    **[Test build #48548 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48548/consoleFull)** for PR 10390 at commit [`62fa738`](https://github.com/apache/spark/commit/62fa738dca9e7848156772ec99d5f956622321d9).


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48808392
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/encoders/ExpressionEncoderSuite.scala ---
    @@ -242,6 +242,16 @@ class ExpressionEncoderSuite extends SparkFunSuite {
         ExpressionEncoder.tuple(intEnc, ExpressionEncoder.tuple(intEnc, longEnc))
       }
     
    +  test("user type with ScalaReflection") {
    +    val point = (new ExamplePoint(0.1, 0.2), new ExamplePoint(0.3, 0.4))
    +    val schema = ScalaReflection.schemaFor[Tuple2[ExamplePoint, ExamplePoint]]
    +      .dataType.asInstanceOf[StructType]
    +    val attributeSeq = schema.toAttributes
    +    val boundEncoder = encoderFor[Tuple2[ExamplePoint, ExamplePoint]]
    +      .resolve(attributeSeq, outers).bind(attributeSeq)
    +    assert(boundEncoder.fromRow(boundEncoder.toRow(point)) === point)
    +  }
    --- End diff --
    
    Thanks. I've updated it according to your comments.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-165975326
  
    **[Test build #48050 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48050/consoleFull)** for PR 10390 at commit [`51b76b1`](https://github.com/apache/spark/commit/51b76b163a95de571d01473a24fda7773db57498).
     * 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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168899568
  
    **[Test build #48721 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48721/consoleFull)** for PR 10390 at commit [`80a3f7b`](https://github.com/apache/spark/commit/80a3f7b56f14eeb1b7c3d84cc2544458d9de13cd).
     * 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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166245847
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48100/
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-166245845
  
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-168150653
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/48547/
    Test FAILed.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48122523
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala ---
    @@ -89,6 +94,23 @@ class UserDefinedTypeSuite extends QueryTest with SharedSQLContext with ParquetT
         assert(featuresArrays.contains(new MyDenseVector(Array(0.2, 2.0))))
       }
     
    +  test("user type with ScalaReflection") {
    +    val points = Seq(
    +      MyLabeledPoint(1.0, new MyDenseVector(Array(0.1, 1.0))),
    +      MyLabeledPoint(0.0, new MyDenseVector(Array(0.2, 2.0))))
    +
    +    val schema = ScalaReflection.schemaFor[MyLabeledPoint].dataType.asInstanceOf[StructType]
    +    val attributeSeq = schema.toAttributes
    +
    +    val pointEncoder = encoderFor[MyLabeledPoint]
    +    val unsafeRows = points.map(pointEncoder.toRow(_).copy())
    --- End diff --
    
    I added the test now. By doing this, I also found that we need to add UserDefinedType to Cast to make it work.


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-167975180
  
    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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-165961628
  
    **[Test build #48050 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/48050/consoleFull)** for PR 10390 at commit [`51b76b1`](https://github.com/apache/spark/commit/51b76b163a95de571d01473a24fda7773db57498).


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#issuecomment-167954678
  
    @marmbrus Thanks. However, to move the test means that we need to move the UDT classes to encoder tests. I think it might duplicate the codes. Is it ok for you?


---
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: [SPARK-12438][SQL] Add SQLUserDefinedType supp...

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

    https://github.com/apache/spark/pull/10390#discussion_r48132773
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala ---
    @@ -81,6 +81,9 @@ object Cast {
                     toField.nullable)
             }
     
    +    case (udt1: UserDefinedType[_], udt2: UserDefinedType[_]) if udt1.userClass == udt2.userClass =>
    --- End diff --
    
    This fixing is submitted as pr #10410.


---
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