HyukjinKwon commented on issue #23202: [SPARK-26248][SQL] Infer date type from 
CSV
URL: https://github.com/apache/spark/pull/23202#issuecomment-447701620
 
 
   What I mean by exact match is, for instance, we use `FastDateFormat` (which 
is compatible with `SimpleDateFormat`):
   
   
https://github.com/apache/spark/blob/8a27952cdbf492939d9bda59e2f516f574581636/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TimestampFormatter.scala#L95
   
   
https://github.com/apache/spark/blob/8a27952cdbf492939d9bda59e2f516f574581636/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TimestampFormatter.scala#L157
   
   How do we handle the case below when legacy is on?
   
   ```
   scala> import org.apache.commons.lang3.time.FastDateFormat
   import org.apache.commons.lang3.time.FastDateFormat
   
   scala> FastDateFormat.getInstance("yyyy-MM").parse("2010-10-10")
   res19: java.util.Date = Fri Oct 01 00:00:00 SGT 2010
   
   scala> FastDateFormat.getInstance("yyyy-MM-dd").parse("2010-10-10")
   res20: java.util.Date = Sun Oct 10 00:00:00 SGT 2010
   ```
   
   It's going to introduce some arbitrary behaviours to end users.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to