sqoop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Popov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SQOOP-2993) ClassCastException in case single value of LONGVARCHAR partition column
Date Fri, 05 Aug 2016 07:39:20 GMT

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

Michael Popov updated SQOOP-2993:
---------------------------------
    Description: 
In case partition column is specified, its type is LONGVARCHAR (VARCHAR, CHAR) and there is
single column value for the entire entries set. in this case 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}

  was:
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}


> 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. in this case 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)

Mime
View raw message