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: [email protected]
For additional commands, e-mail: [email protected]