You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sqoop.apache.org by "Sergey Svinarchuk (JIRA)" <ji...@apache.org> on 2016/08/18 09:52:20 UTC

[jira] [Created] (SQOOP-3001) Import from Mysql broken with "Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.math.BigDecimal"

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)