Michael Popov created SQOOP-2993:
------------------------------------

             Summary: ClassCastException in case single value of LONGVARCHAR 
partition column
                 Key: SQOOP-2993
                 URL: https://issues.apache.org/jira/browse/SQOOP-2993
             Project: Sqoop
          Issue Type: Bug
          Components: connectors/generic
    Affects Versions: 1.99.5
            Reporter: Michael Popov


In case partition column is specified, its type is LONGVARCHAR (VARCHAR, CHAR) 
and there is single column value for the entire entries set partitions could 
not be created due to ClassCastException

{code:title=Stack trace|borderStyle=solid}
[errorSummary=java.lang.ClassCastException: java.lang.Integer cannot be cast to 
java.math.BigDecimal, errorDetails=java.lang.ClassCastException: 
java.lang.Integer cannot be cast to java.math.BigDecimal
        at 
org.apache.sqoop.connector.jdbc.GenericJdbcPartitioner.constructTextConditions(GenericJdbcPartitioner.java:529)
        at 
org.apache.sqoop.connector.jdbc.GenericJdbcPartitioner.partitionTextColumn(GenericJdbcPartitioner.java:254)
        at 
org.apache.sqoop.connector.jdbc.GenericJdbcPartitioner.getPartitions(GenericJdbcPartitioner.java:118)
        at 
org.apache.sqoop.connector.jdbc.GenericJdbcPartitioner.getPartitions(GenericJdbcPartitioner.java:38)
{code}
The error is caused by incorrect cast 

{code:title=GenericJdbcPartitioner.java|borderStyle=solid}
String lbString = prefix + bigDecimalToText((BigDecimal)lowerBound);
String ubString = prefix + bigDecimalToText((BigDecimal)upperBound);
{code}



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

Reply via email to