Github user viirya commented on a diff in the pull request: https://github.com/apache/spark/pull/18875#discussion_r137987691 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonGenerator.scala --- @@ -193,14 +228,32 @@ private[sql] class JacksonGenerator( * * @param row The row to convert */ - def write(row: InternalRow): Unit = writeObject(writeFields(row, schema, rootFieldWriters)) + def write(row: InternalRow): Unit = dataType match { + case st: StructType => + writeObject(writeFields(row, st, rootFieldWriters)) + case _ => throw new UnsupportedOperationException( --- End diff -- hmm, what type of exception thrown now if call `write(row)` when the generator is initialized with `MapType`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org