[ 
https://issues.apache.org/jira/browse/SPARK-32205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17152594#comment-17152594
 ] 

Nilesh Patil edited comment on SPARK-32205 at 7/7/20, 9:27 AM:
---------------------------------------------------------------

[~JinxinTang] As per your suggestion "*mysql Date type has 1000-01-01 00:00:00' 
to '9999-12-31 23:59:59' range ".*  I can see in mysql doc Date datatype range 
is *{{`1}}{{000-01-01'}}* to {{*'9999-12-31'*}} only date range is supported 
not time. And as per provided solution of casting we can only insert date in 
predefined table having date datatype there will be truncation of time value. 
*e..g *9999-12-31* only this date will get inserted, *23:59:59* this time value 
gets truncated.**


was (Author: nileshr.patil):
[~JinxinTang] As per your suggestion "*mysql Date type has 1000-01-01 00:00:00' 
to '9999-12-31 23:59:59' range ".*  I can see in mysql doc Date datatype range 
is *{{`1}}{{000-01-01'}}* to {{*'9999-12-31'*}} only date range is supported 
not time. And as per solution of casting we can only insert date in predefined 
table having date datatype there will be truncation of time value. *e..g 
*9999-12-31* only this date will get inserted, *23:59:59* this time value gets 
truncated.**

> Writing timestamp in mysql gets fails 
> --------------------------------------
>
>                 Key: SPARK-32205
>                 URL: https://issues.apache.org/jira/browse/SPARK-32205
>             Project: Spark
>          Issue Type: Bug
>          Components: Java API
>    Affects Versions: 2.3.4
>            Reporter: Nilesh Patil
>            Priority: Major
>
> When we are writing to mysql with TIMESTAMP column it supports only range 
> '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07'. Mysql has DATETIME 
> datatype which has 1000-01-01 00:00:00' to '9999-12-31 23:59:59' range.
> How to map spark timestamp datatype to mysql datetime datatype in order to 
> use higher supporting range ?
> [https://dev.mysql.com/doc/refman/5.7/en/datetime.html]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to