Github user marmbrus commented on a diff in the pull request:
    --- Diff: 
    @@ -343,4 +343,23 @@ class JsonExpressionsSuite extends SparkFunSuite with 
ExpressionEvalHelper {
    +  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 --
    Yeah, I think it makes more sense to add a static check for this case.  We 
know all of the types that we are able to handle.  For consistency I would also 
add this to the `write.json` code path.

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to