spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srowen <...@git.apache.org>
Subject [GitHub] spark pull request #19053: [SPARK-21837][SQL][TESTS] UserDefinedTypeSuite lo...
Date Fri, 25 Aug 2017 11:11:06 GMT
Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19053#discussion_r135235516
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala ---
    @@ -203,12 +203,14 @@ class UserDefinedTypeSuite extends QueryTest with SharedSQLContext
with ParquetT
     
       // Tests to make sure that all operators correctly convert types on the way out.
       test("Local UDTs") {
    -    val df = Seq((1, new UDT.MyDenseVector(Array(0.1, 1.0)))).toDF("int", "vec")
    -    df.collect()(0).getAs[UDT.MyDenseVector](1)
    -    df.take(1)(0).getAs[UDT.MyDenseVector](1)
    -    df.limit(1).groupBy('int).agg(first('vec)).collect()(0).getAs[UDT.MyDenseVector](0)
    -    df.orderBy('int).limit(1).groupBy('int).agg(first('vec)).collect()(0)
    -      .getAs[UDT.MyDenseVector](0)
    +    val vec = new UDT.MyDenseVector(Array(0.1, 1.0))
    +    val df = Seq((1, vec)).toDF("int", "vec")
    +    assert(vec === df.collect()(0).getAs[UDT.MyDenseVector](1))
    +    assert(vec === df.take(1)(0).getAs[UDT.MyDenseVector](1))
    +    assert(vec === df.limit(1).groupBy('int).agg(first('vec)).collect()(0)
    --- End diff --
    
    Note that this and the next line fails with the assert added, if it is left dereferencing
col 0 at the end instead of 1.


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


Mime
View raw message