Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/15354#discussion_r83350521 --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/expressions/JsonExpressionsSuite.scala --- @@ -343,4 +343,23 @@ class JsonExpressionsSuite extends SparkFunSuite with ExpressionEvalHelper { null ) } + + test("to_json") { + val schema = StructType(StructField("a", IntegerType) :: Nil) + val struct = Literal.create(create_row(1), schema) + checkEvaluation( + StructToJson(Map.empty, struct), + """{"a":1}""" + ) + } + + test("to_json - invalid type") { + val schema = StructType(StructField("a", CalendarIntervalType) :: Nil) --- End diff -- @marmbrus Do you mind if I ask to create another JIRA and deal with this problem for JSON/CSV for reading/writing paths? It seems I should add this logics separatlely from `JacksonGenerator` instance (as it seems initiated in tasks and it is used `DataSet.toJSON`, `StructToJson` and `write.json` and therefore, it seems I should add a separate test for each..)
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org