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

Sqoop import does not recognize Primary Key of a IBM DB2 table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.4.5
    • 1.5.0
    • None
    • None
    • IBM DB2 9,.7V

    Description

      Currently Sqoop import query does not recognize the PK of IBM DB2 table.

      When any sqoop query runs for DB2 table, it is not able to recognize the primary key(PK) of that table, which is used as --split-by column implicitly. To run the Sqoop query it is mandatory to give --split-by <colname> explicitly.

      Query Given below:

      sqoop import -Dmapred.job.queue.name=edwdev --connect jdbc:db2://dle-db2edw01.dl.karmalab.net:50001/EXPDEV01 --username='********' -P --table edwdev.mytable --hive-import --hive-table platdev.mytable_dynapart --hive-external-table --target-dir /user/lbansal/hive_data_dynapart/testdir --hive-dynamic-partition --hive-partition-key DATE --hive-partition-key-format aa-zzzz --incremental lastmodified --check-column DATE --last-value '2014-10-22' --append
      gives the following error message:
      14/11/21 02:17:32 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM edwdev.mytable AS t WHERE 1=0
      14/11/21 02:17:33 INFO tool.ImportTool: Incremental import based on column DATE
      14/11/21 02:17:33 INFO tool.ImportTool: Lower bound value: '2014-10-22'
      14/11/21 02:17:33 INFO tool.ImportTool: Upper bound value: '2014-11-21 02:17:33.680951'
      14/11/21 02:17:34 INFO hive.metastore: Trying to connect to metastore with URI thrift://cheledwhdd004.karmalab.net:9083
      14/11/21 02:17:34 INFO hive.metastore: Connected to metastore.
      14/11/21 02:17:34 WARN tool.HiveUtil: platdev.mytable_dynapart table not found
      14/11/21 02:17:34 WARN tool.HiveUtil: platdev.mytable_dynapart table not found
      14/11/21 02:17:34 ERROR tool.ImportTool: Error during import: No primary key could be found for table edwdev.mytable. Please specify one with --split-by or perform a sequential import with '-m 1'.
      

      Attachments

        1. SQOOP-2328_0.patch
          3 kB
          Shashank

        Issue Links

          Activity

            People

              standon Shashank
              atugupta Atul Gupta
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: