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

Sqoop should support importing from table with column names containing some special character

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.4.5, 1.4.6
    • 1.4.7
    • hive-integration
    • None
    • HDP 2.2.0.0-2041

    Description

      This sqoop import:

      sqoop import --connect jdbc:mysql://some.merck.com:1234/dbname --username XXX --password YYY --table some_table --hcatalog-database some_database --hcatalog-table some_table --hive-partition-key mg_version --hive-partition-value 2015-05-28-13-18 -m 1 --verbose --fetch-size -2147483648
      

      fails with with this error:

      2015-06-01 13:20:39,209 WARN [main] org.apache.hadoop.mapred.YarnChild: Exception running child : java.lang.NullPointerException
      	at org.apache.hive.hcatalog.data.schema.HCatSchema.get(HCatSchema.java:105)
      	at org.apache.sqoop.mapreduce.hcat.SqoopHCatImportHelper.convertToHCatRecord(SqoopHCatImportHelper.java:194)
      	at org.apache.sqoop.mapreduce.hcat.SqoopHCatImportMapper.map(SqoopHCatImportMapper.java:52)
      	at org.apache.sqoop.mapreduce.hcat.SqoopHCatImportMapper.map(SqoopHCatImportMapper.java:34)
      	at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145)
      	at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784)
      	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341)
      	at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at javax.security.auth.Subject.doAs(Subject.java:415)
      	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1628)
      	at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)
      

      It seems that the error is caused by a column name containing a hyphen ('-'). Column names are converted to java identifiers but later this converted name could not be found in HCatalog schema.

      Attachments

        1. SQOOP-2387.patch
          27 kB
          Venkat Ranganathan
        2. SQOOP-2387.2.patch
          5 kB
          Venkatesan Ramachandran
        3. SQOOP-2387.1.patch
          7 kB
          Venkatesan Ramachandran
        4. sqoop.log
          115 kB
          Pavel Benes
        5. joblog.txt
          6 kB
          Pavel Benes
        6. SQOOP-2387.patch
          8 kB
          Pavel Benes

        Issue Links

          Activity

            People

              venkatnrangan Venkat Ranganathan
              pbenes Pavel Benes
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: