Issue Details (XML | Word | Printable)

Key: HADOOP-5887
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Aaron Kimball
Reporter: Aaron Kimball
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Sqoop should create tables in Hive metastore after importing to HDFS

Created: 21/May/09 09:22 PM   Updated: 25/Sep/09 09:36 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.21.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works HADOOP-5887.2.patch 2009-06-03 05:21 PM Aaron Kimball 52 kB
Text File Licensed for inclusion in ASF works HADOOP-5887.patch 2009-05-21 09:23 PM Aaron Kimball 52 kB
Issue Links:
Dependants
 

Hadoop Flags: Reviewed
Release Note: New Sqoop argument --hive-import facilitates loading data into Hive.
Resolution Date: 23/Jun/09 04:34 PM


 Description  « Hide
Sqoop (HADOOP-5815) imports tables into HDFS; it is a straightforward enhancement to then generate a Hive DDL statement to recreate the table definition in the Hive metastore and move the imported table into the Hive warehouse directory from its upload target.

This feature enhancement makes this process automatic. An import is performed with sqoop in the usual way; providing the argument "--hive-import" will cause it to then issue a CREATE TABLE .. LOAD DATA INTO statement to a Hive shell. It generates a script file and then attempts to run "$HIVE_HOME/bin/hive" on it, or failing that, any "hive" on the $PATH; $HIVE_HOME can be overridden with --hive-home. As a result, no direct linking against Hive is necessary.

The unit tests provided with this enhancement use a mock implementation of 'bin/hive' that compares the script it's fed with one from a directory full of "expected" scripts. The exact script file referenced is controlled via an environment variable. It doesn't actually load into a proper Hive metastore, but manual testing has shown that this process works in practice, so the mock implementation is a reasonable unit testing tool.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Aaron Kimball made changes - 21/May/09 09:23 PM
Field Original Value New Value
Attachment HADOOP-5887.patch [ 12408740 ]
Aaron Kimball made changes - 21/May/09 09:23 PM
Status Open [ 1 ] Patch Available [ 10002 ]
Aaron Kimball made changes - 21/May/09 09:24 PM
Link This issue depends on HADOOP-5815 [ HADOOP-5815 ]
Aaron Kimball made changes - 03/Jun/09 05:21 PM
Status Patch Available [ 10002 ] Open [ 1 ]
Aaron Kimball made changes - 03/Jun/09 05:21 PM
Attachment HADOOP-5887.2.patch [ 12409797 ]
Aaron Kimball made changes - 03/Jun/09 05:21 PM
Status Open [ 1 ] Patch Available [ 10002 ]
Tom White made changes - 23/Jun/09 04:34 PM
Resolution Fixed [ 1 ]
Fix Version/s 0.21.0 [ 12313563 ]
Hadoop Flags [Reviewed]
Status Patch Available [ 10002 ] Resolved [ 5 ]
Robert Chansler made changes - 25/Sep/09 09:36 PM
Release Note Add capability for Sqoop to import table definitions into Hive New Sqoop argument --hive-import facilitates loading data into Hive.