Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20937#discussion_r183271569
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
 ---
    @@ -361,6 +361,12 @@ class JacksonParser(
             // For such records, all fields other than the field configured by
             // `columnNameOfCorruptRecord` are set to `null`.
             throw BadRecordException(() => recordLiteral(record), () => None, 
e)
    +      case e: CharConversionException if options.encoding.isEmpty =>
    +        val msg =
    +          """JSON parser cannot handle a character in its input.
    +            |Specifying encoding as an input option explicitly might help 
to resolve the issue.
    +            |""".stripMargin + e.getMessage
    +        throw new CharConversionException(msg)
    --- End diff --
    
    BTW we should also follow the existing rule and wrap the exception with 
`BadRecordException`. See the code above.


---

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

Reply via email to