spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gengliangwang <...@git.apache.org>
Subject [GitHub] spark pull request #22895: [SPARK-25886][SQL][Minor] Improve error message o...
Date Wed, 31 Oct 2018 04:58:10 GMT
Github user gengliangwang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22895#discussion_r229564121
  
    --- 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 {
    +            ""
    +          }
    +          throw new SparkException(msg + "Malformed records are detected in record parsing.
" +
                 s"Current parse Mode: ${FailFastMode.name}. To process malformed records
as null " +
    -            "result, try setting the option 'mode' as 'PERMISSIVE'.", e.getCause)
    +            "result, try setting the option 'mode' as 'PERMISSIVE'.", e)
    --- End diff --
    
    Agree, When I post the output, I have the same thought..Haha.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message