Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/15792#discussion_r86764524 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/jsonExpressions.scala --- @@ -495,11 +495,8 @@ case class JsonToStruct(schema: StructType, options: Map[String, String], child: new JSONOptions(options ++ Map("mode" -> ParseModes.FAIL_FAST_MODE))) override def dataType: DataType = schema - override def children: Seq[Expression] = child :: Nil - override def eval(input: InternalRow): Any = { - val json = child.eval(input) - if (json == null) return null + override def nullSafeEval(json: Any): Any = { --- End diff -- Yes, null safety for `from_json` was fixed in https://github.com/apache/spark/commit/6e2701815761d5870111cb56300e30d3059b39ed but I just decided to remove (a little bit) code duplication while matching `to_json` to `from_json`.
--- 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