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

    https://github.com/apache/spark/pull/22031#discussion_r210468640
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala ---
    @@ -2302,6 +2302,76 @@ class DataFrameFunctionsSuite extends QueryTest with 
SharedSQLContext {
         assert(ex5.getMessage.contains("function map_zip_with does not support 
ordering on type map"))
       }
     
    +  test("arrays zip_with function - for primitive types") {
    +    val df1 = Seq[(Seq[Integer], Seq[Integer])](
    +      (Seq(9001, 9002, 9003), Seq(4, 5, 6)),
    +      (Seq(1, 2), Seq(3, 4)),
    +      (Seq.empty, Seq.empty),
    +      (null, null)
    +    ).toDF("val1", "val2")
    +    val df2 = Seq[(Seq[Integer], Seq[Long])](
    +      (Seq(1, null, 3), Seq(1L, 2L)),
    +      (Seq(1, 2, 3), Seq(4L, 11L))
    +    ).toDF("val1", "val2")
    +
    +    val expectedValue1 = Seq(
    +      Row(Seq(9005, 9007, 9009)),
    +      Row(Seq(4, 6)),
    +      Row(Seq.empty),
    +      Row(null))
    +    checkAnswer(df1.selectExpr("zip_with(val1, val2, (x, y) -> x + y)"), 
expectedValue1)
    +
    +    val expectedValue2 = Seq(
    +      Row(Seq(Row(1.0, 1), Row(2.0, null), Row(null, 3))),
    --- End diff --
    
    Why `1.0` or `2.0` instead of `1L` or `2L`?


---

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

Reply via email to