You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Hyukjin Kwon (JIRA)" <ji...@apache.org> on 2016/07/19 06:44:20 UTC
[jira] [Comment Edited] (SPARK-16216) CSV data source does not
write date and timestamp correctly
[ https://issues.apache.org/jira/browse/SPARK-16216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15383664#comment-15383664 ]
Hyukjin Kwon edited comment on SPARK-16216 at 7/19/16 6:44 AM:
---------------------------------------------------------------
JSON writes date and timestamp as a string format as below:
{code}
// TimestampType
1970-01-01 11:46:40.0
// DateType
1970-01-01
{code}
So, like [~srowen] suggested for CSV, this might have to be written as timestamp (as long values) by default with configurable option for this.
was (Author: hyukjin.kwon):
JSON writes date and timestamp as a string format as below:
{code}
// TimestampType
1970-01-01 11:46:40.0
// DateType
1970-01-01
{code}
So, as [~srowen] suggested, this might have to be written as timestamp (as long values) by default.
> CSV data source does not write date and timestamp correctly
> -----------------------------------------------------------
>
> Key: SPARK-16216
> URL: https://issues.apache.org/jira/browse/SPARK-16216
> Project: Spark
> Issue Type: Improvement
> Components: SQL
> Affects Versions: 2.0.0
> Reporter: Hyukjin Kwon
> Priority: Minor
>
> Currently, CSV data source write {{DateType}} and {{TimestampType}} as below:
> {code}
> +----------------+
> | date|
> +----------------+
> |1440637200000000|
> |1414459800000000|
> |1454040000000000|
> +----------------+
> {code}
> It would be nicer if it write dates and timestamps as a formatted string just like JSON data sources.
> Also, CSV data source currently supports {{dateFormat}} option to read dates and timestamps in a custom format. It might be better if this option can be applied in writing as well.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org