sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Svinarchuk (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SQOOP-3001) Import from Mysql broken with "Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal"
Date Thu, 18 Aug 2016 09:52:20 GMT
Sergey Svinarchuk created SQOOP-3001:
----------------------------------------

             Summary: Import from Mysql broken with "Caused by: java.lang.ClassCastException:
java.lang.Integer cannot be cast to java.math.BigDecimal"
                 Key: SQOOP-3001
                 URL: https://issues.apache.org/jira/browse/SQOOP-3001
             Project: Sqoop
          Issue Type: Bug
          Components: connectors/generic
    Affects Versions: 1.99.7
            Reporter: Sergey Svinarchuk


After patch from SQOOP-2244, Sqoop incorrect get type for column.
Example for select with automatically escape column names:
{code}
mysql> create table test (id int);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into test value (1);
Query OK, 1 row affected (0.04 sec)

mysql> insert into test value (9);
Query OK, 1 row affected (0.01 sec)

mysql> select min("id"), max("id") from test;
+-----------+-----------+
| min("id") | max("id") |
+-----------+-----------+
| id            | id            |
+-----------+-----------+
1 row in set (0.00 sec)
{code}

But real results must be:
{code}
mysql> select min(id), max(id) from test;
+---------+---------+
| min(id) | max(id) |
+---------+---------+
|       1    |       9     |
+---------+---------+
1 row in set (0.00 sec)
{code}
So when we use auto escape, Sqoop getting String value for int column in Mysql



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message