Sqoop
  1. Sqoop
  2. SQOOP-1048

Sqoop2: NPE when importing NULL value

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.99.2
    • Fix Version/s: 1.99.3
    • Component/s: None
    • Labels:
      None
    • Environment:

      Mysql DB

      Description

      Throws NullPointerException when column value is NULL, since result set return null object.

      org.apache.sqoop.common.SqoopException: MAPRED_EXEC_0017:Error occurs during extractor run
      at org.apache.sqoop.job.mr.SqoopMapper.run(SqoopMapper.java:94)
      at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
      at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:396)
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
      at org.apache.hadoop.mapred.Child.main(Child.java:249)
      Caused by: org.apache.sqoop.common.SqoopException: MAPRED_EXEC_0013:Cannot write to the data writer
      at org.apache.sqoop.job.mr.SqoopMapper$MapDataWriter.writeContent(SqoopMapper.java:142)
      at org.apache.sqoop.job.mr.SqoopMapper$MapDataWriter.writeArrayRecord(SqoopMapper.java:124)
      at org.apache.sqoop.connector.jdbc.GenericJdbcImportExtractor.extract(GenericJdbcImportExtractor.java:60)
      at org.apache.sqoop.connector.jdbc.GenericJdbcImportExtractor.extract(GenericJdbcImportExtractor.java:31)
      at org.apache.sqoop.job.mr.SqoopMapper.run(SqoopMapper.java:89)
      ... 7 more
      Caused by: java.lang.NullPointerException
      at org.apache.sqoop.job.io.Data.hashCode(Data.java:140)
      at org.apache.hadoop.mapreduce.lib.partition.HashPartitioner.getPartition(HashPartitioner.java:29)
      at org.apache.hadoop.mapred.MapTask$NewOutputCollector.write(MapTask.java:691)
      at org.apache.hadoop.mapreduce.TaskInputOutputContext.write(TaskInputOutputContext.java:80)
      at org.apache.sqoop.job.mr.SqoopMapper$MapDataWriter.writeContent(SqoopMapper.java:140)
      ... 11 more

      1. SQOOP-1048.patch
        2 kB
        Vasanth kumar RJ

        Activity

        Hide
        Jarek Jarcec Cecho added a comment -

        I'm expecting that the proper format will be further defined by SQOOP-777 (once fully implemented), however I'm +1 for immediate solution.

        Show
        Jarek Jarcec Cecho added a comment - I'm expecting that the proper format will be further defined by SQOOP-777 (once fully implemented), however I'm +1 for immediate solution.
        Show
        Jarek Jarcec Cecho added a comment - The patch is in: https://git-wip-us.apache.org/repos/asf?p=sqoop.git;a=commit;h=61335e6e821c40dfa258c8000514c5d1040d1788 Thank you Vasanth!
        Hide
        Hudson added a comment -

        Integrated in Sqoop2-hadoop200 #291 (See https://builds.apache.org/job/Sqoop2-hadoop200/291/)
        SQOOP-1048: Sqoop2: NPE when importing NULL value (Revision 61335e6e821c40dfa258c8000514c5d1040d1788)

        Result = FAILURE
        jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=61335e6e821c40dfa258c8000514c5d1040d1788
        Files :

        • connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorConstants.java
        • connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
        Show
        Hudson added a comment - Integrated in Sqoop2-hadoop200 #291 (See https://builds.apache.org/job/Sqoop2-hadoop200/291/ ) SQOOP-1048 : Sqoop2: NPE when importing NULL value (Revision 61335e6e821c40dfa258c8000514c5d1040d1788) Result = FAILURE jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=61335e6e821c40dfa258c8000514c5d1040d1788 Files : connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorConstants.java connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
        Hide
        Hudson added a comment -

        Integrated in Sqoop2-hadoop100 #286 (See https://builds.apache.org/job/Sqoop2-hadoop100/286/)
        SQOOP-1048: Sqoop2: NPE when importing NULL value (Revision 61335e6e821c40dfa258c8000514c5d1040d1788)

        Result = FAILURE
        jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=61335e6e821c40dfa258c8000514c5d1040d1788
        Files :

        • connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java
        • connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorConstants.java
        Show
        Hudson added a comment - Integrated in Sqoop2-hadoop100 #286 (See https://builds.apache.org/job/Sqoop2-hadoop100/286/ ) SQOOP-1048 : Sqoop2: NPE when importing NULL value (Revision 61335e6e821c40dfa258c8000514c5d1040d1788) Result = FAILURE jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=61335e6e821c40dfa258c8000514c5d1040d1788 Files : connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcImportExtractor.java connector/connector-generic-jdbc/src/main/java/org/apache/sqoop/connector/jdbc/GenericJdbcConnectorConstants.java

          People

          • Assignee:
            Vasanth kumar RJ
            Reporter:
            Vasanth kumar RJ
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development