Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/22237#discussion_r222651484 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala --- @@ -550,59 +550,93 @@ case class JsonToStructs( s"Input schema ${nullableSchema.catalogString} must be a struct, an array or a map.") } - // This converts parsed rows to the desired output by the given schema. - @transient - lazy val converter = nullableSchema match { - case _: StructType => - (rows: Seq[InternalRow]) => if (rows.length == 1) rows.head else null - case _: ArrayType => - (rows: Seq[InternalRow]) => rows.head.getArray(0) - case _: MapType => - (rows: Seq[InternalRow]) => rows.head.getMap(0) + abstract class RowParser { --- End diff -- can it be `trait`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org