Github user patrickmcgloin commented on a diff in the pull request: https://github.com/apache/spark/pull/21671#discussion_r199319281 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonGenerator.scala --- @@ -163,6 +175,22 @@ private[sql] class JacksonGenerator( s"with the type of $dataType to JSON.") } + private def makeReader(dataType: DataType): ValueReader = dataType match { + + case TimestampType => + (row: SpecializedGetters, ordinal: Int) => + options.timestampFormat.format(DateTimeUtils.toJavaTimestamp(row.getLong(ordinal))) + + case DateType => + (row: SpecializedGetters, ordinal: Int) => + options.dateFormat.format(DateTimeUtils.toJavaDate(row.getInt(ordinal))) + + case _ => + (row: SpecializedGetters, ordinal: Int) => + row.get(ordinal, dataType).toString --- End diff -- Actually, now that I consider it a bit more I think nested types are not possible. The result has to be stored as a String, e.g. "key": "value" Putting the nested type inside the name of the JSON wouldn't be possible.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org