[ 
https://issues.apache.org/jira/browse/MAPREDUCE-1235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aaron Kimball updated MAPREDUCE-1235:
-------------------------------------

    Attachment: MAPREDUCE-1235.patch

Attaching patch to fix this issue. MySQL supports TIMESTAMP values of 
'0000-00-00 00:00:00' which is out-of-range for java.sql.Timestamp. MySQL 
allows various behaviors for handling this; the default used to be to convert 
this value to null; since MySQL 5 it now throws IOException when such a 
timestamp is retrieved.

Sqoop now sets the default behavior to be convert these values to 'null', since 
this is a reasonable data conversion given the imprecision available. Users can 
override this default by passing the {{zeroDateTimeBehavior=exception}} 
parameter in the connect string.

> java.io.IOException: Cannot convert value '0000-00-00 00:00:00' from column 6 
> to TIMESTAMP. 
> --------------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-1235
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1235
>             Project: Hadoop Map/Reduce
>          Issue Type: Bug
>          Components: contrib/sqoop
>    Affects Versions: 0.20.1
>         Environment: hadoop 0.20.1
> sqoop
> ubuntu karmic
> mysql 4
>            Reporter: valentina kroshilina
>            Assignee: Aaron Kimball
>            Priority: Minor
>         Attachments: MAPREDUCE-1235.patch
>
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> *Description*: java.io.IOException is thrown when trying to import a table to 
> HDFS using Sqoop. Table has "0" value in a field of type datetime. 
> *Full Exception*: java.io.IOException: Cannot convert value '0000-00-00 
> 00:00:00' from column 6 to TIMESTAMP. 
> *Original question*: 
> http://getsatisfaction.com/cloudera/topics/cant_import_table?utm_content=reply_link&utm_medium=email&utm_source=reply_notification

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to