spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From HyukjinKwon <...@git.apache.org>
Subject [GitHub] spark pull request #20884: [SPARK-23773][SQL] JacksonGenerator does not incl...
Date Sat, 24 Mar 2018 02:26:26 GMT
Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20884#discussion_r176897268
  
    --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/json/JacksonGeneratorSuite.scala
---
    @@ -56,7 +56,7 @@ class JacksonGeneratorSuite extends SparkFunSuite {
         val gen = new JacksonGenerator(dataType, writer, option)
         gen.write(input)
         gen.flush()
    -    assert(writer.toString === """[{}]""")
    +    assert(writer.toString === """[{"a":null}]""")
    --- End diff --
    
    I think you should compare this:
    
    ```scala
    scala> sql(""" select array(cast(null as struct<k:string>)) as my_array""").toJSON.collect().foreach(println)
    {"my_array":[null]}
    
    scala> sql(""" select array(struct(cast(null as string))) as my_array""").toJSON.collect().foreach(println)
    {"my_array":[{}]}
    ```


---

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


Mime
View raw message