Github user gengliangwang commented on a diff in the pull request: https://github.com/apache/spark/pull/22895#discussion_r229553580 --- Diff: external/avro/src/main/scala/org/apache/spark/sql/avro/AvroDataToCatalyst.scala --- @@ -100,9 +100,14 @@ case class AvroDataToCatalyst( case NonFatal(e) => parseMode match { case PermissiveMode => nullResultRow case FailFastMode => - throw new SparkException("Malformed records are detected in record parsing. " + + val msg = if (e.getMessage != null) { + e.getMessage + "\n" + } else { + "" + } --- End diff -- Yes, but as there is such code `e.getMessage + "\n`, personally I prefer not to inline it.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org