[
https://issues.apache.org/jira/browse/SQOOP-2018?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14279777#comment-14279777
]
Qian Xu edited comment on SQOOP-2018 at 1/16/15 6:30 AM:
---------------------------------------------------------
Some more info: The failed schema contains a column "INT(11)". The byte size is
4. The object type is Long.
I think there are two problems:
1. Long's byte size is 8. Currently it is interpreted as 4 unexpectedly.
2. The patch checks byte size against {{Integer.SIZE}}, which is bit size not
byte size.
{code}
if (byteSize != null && byteSize <= 4L) {
return ((Integer) obj).toString();
} else {
return ((Long) obj).toString();
}
{code}
was (Author: stanleyxu2005):
Some more info: The failed schema contains a column "INT(11)". The byte size is
4. The object type is Long.
I think there are two problems:
1. Long's byte size is 8. Currently it is interpreted as 4 unexpectedly.
2. The patch checks byte size against {{Integer.SIZE}}, which is bit size not
byte size.
{code}
if (byteSize != null && byteSize <= Integer.SIZE) {
returnValue = Integer.valueOf(csvString);
} else {
returnValue = Long.valueOf(csvString);
}
{code}
> GenericJDBCConnector SqlTypes INTEGER should be set 4 bytes
> -----------------------------------------------------------
>
> Key: SQOOP-2018
> URL: https://issues.apache.org/jira/browse/SQOOP-2018
> Project: Sqoop
> Issue Type: Bug
> Reporter: Veena Basavaraj
> Assignee: Veena Basavaraj
> Fix For: 1.99.5
>
> Attachments: SQOOP-2018-take2patch, SQOOP-2018.patch
>
>
> treat INT as 4 bytes since both MySQL and Oracle and Postgres do it so
> http://dev.mysql.com/doc/refman/5.0/en/integer-types.html
> https://docs.oracle.com/cd/E17952_01/refman-5.5-en/storage-requirements.html
> http://www.postgresql.org/docs/9.1/static/datatype-numeric.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)