Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-483

Allow target dir to be set to a different name than table name for hive import

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.2
    • Component/s: None
    • Labels:
      None

      Description

      Currently, the table name (set by --table) has to be the same as the target dir (set by --target-dir) for hive import. But it would be nice if the target dir could be set to a different name than the table name.

      For example, we like to be able to run something like:

      sqoop import ... --table "foo" --target-dir "foo1" --hive-import
      sqoop import ... --table "foo" --target-dir "foo2" --hive-import
      

      Now this generates the following call stack:

      12/05/02 17:11:55 INFO hive.HiveImport: FAILED: Error in semantic analysis: Line 2:17 Invalid path 'hdfs://localhost/user/cheolsoo/foo': No files matching path hdfs://localhost/user/cheolsoo/foo 
      12/05/02 17:11:56 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Hive exited with status 10 
      at com.cloudera.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:349) 
      at com.cloudera.sqoop.hive.HiveImport.executeScript(HiveImport.java:299) 
      at com.cloudera.sqoop.hive.HiveImport.importTable(HiveImport.java:241) 
      at com.cloudera.sqoop.tool.ImportTool.importTable(ImportTool.java:394) 
      at com.cloudera.sqoop.tool.ImportTool.run(ImportTool.java:455) 
      at com.cloudera.sqoop.Sqoop.run(Sqoop.java:146) 
      at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65) 
      at com.cloudera.sqoop.Sqoop.runSqoop(Sqoop.java:182) 
      at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:221) 
      at com.cloudera.sqoop.Sqoop.runTool(Sqoop.java:230) 
      at com.cloudera.sqoop.Sqoop.main(Sqoop.java:239)
      

        Attachments

        1. SQOOP-483.patch
          8 kB
          Cheolsoo Park
        2. SQOOP-483-2.patch
          8 kB
          Cheolsoo Park

          Activity

            People

            • Assignee:
              cheolsoo Cheolsoo Park
              Reporter:
              cheolsoo Cheolsoo Park
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: