You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/17 01:49:41 UTC

[GitHub] HyukjinKwon commented on issue #23202: [SPARK-26248][SQL] Infer date type from CSV

HyukjinKwon commented on issue #23202: [SPARK-26248][SQL] Infer date type from CSV
URL: https://github.com/apache/spark/pull/23202#issuecomment-447699150
 
 
   Timestamp should not tried first. It works for default values but don't work when, for instance, other patterns are set.
   
   For instnace:
   
   
   ```scala
   Seq("2010_10_10").toDF.write.text("/tmp/bar")
   
   spark.read.option("inferSchema", "true")
     .option("header", "false")
     .option("timestampFormat", "yyyy_MM_dd")
     .csv("/tmp/foo").printSchema()
   ```
   
   ```
   root
    |-- _c0: date (nullable = true)
   ```
   
   ```scala
   Seq("2010-10-10").toDF.write.text("/tmp/foo")
   
   spark.read.option("inferSchema", "true")
     .option("header", "false")
     .option("timestampFormat", "yyyy-MM-dd")
     .csv("/tmp/foo").printSchema()
   ```
   
   ```
   root
    |-- _c0: timestamp (nullable = true)
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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