You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by marmbrus <gi...@git.apache.org> on 2014/10/09 21:04:50 UTC

[GitHub] spark pull request: [SPARK-3853][SQL] JSON Schema support for Time...

Github user marmbrus commented on a diff in the pull request:

    https://github.com/apache/spark/pull/2720#discussion_r18666700
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/json/JsonRDD.scala ---
    @@ -361,6 +362,14 @@ private[sql] object JsonRDD extends Logging {
         }
       }
     
    +  private def toTimestamp(value: Any): Timestamp = {
    +    value match {
    +        case value: java.lang.Integer => new Timestamp(value.asInstanceOf[Int].toLong)
    +        case value: java.lang.Long => new Timestamp(value)
    +        case value: java.lang.String => Timestamp.valueOf(value)
    --- End diff --
    
    Actually one more thing.  Will this handle null values?  I think you'll get a match error.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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