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

    https://github.com/apache/spark/pull/16386#discussion_r100064266
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/json/JacksonParser.scala
 ---
    @@ -227,66 +267,71 @@ class JacksonParser(
           }
     
         case TimestampType =>
    -      (parser: JsonParser) => parseJsonToken(parser, dataType) {
    +      (parser: JsonParser) => parseJsonToken[java.lang.Long](parser, 
dataType) {
             case VALUE_STRING =>
    +          val stringValue = parser.getText
               // This one will lose microseconds parts.
               // See https://issues.apache.org/jira/browse/SPARK-10681.
    -          Try(options.timestampFormat.parse(parser.getText).getTime * 
1000L)
    -            .getOrElse {
    -              // If it fails to parse, then tries the way used in 2.0 and 
1.x for backwards
    -              // compatibility.
    -              DateTimeUtils.stringToTime(parser.getText).getTime * 1000L
    -            }
    +          Long.box {
    --- End diff --
    
    I don't think this makes the code more readable...


---
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

Reply via email to