Uploaded image for project: 'Sqoop (Retired)'
  1. Sqoop (Retired)
  2. SQOOP-2993

ClassCastException in case single value of LONGVARCHAR partition column

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.99.5
    • None
    • connectors/generic
    • None

    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

      Stack trace
      [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)
      

      The error is caused by incorrect cast

      GenericJdbcPartitioner.java
      String lbString = prefix + bigDecimalToText((BigDecimal)lowerBound);
      String ubString = prefix + bigDecimalToText((BigDecimal)upperBound);
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            mvpopov Michael Popov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: