TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Bigdata Learnings( Hadoop, HBase,Hive and other bigdata technologies) > Hive: Import and Export data from HDFS and Local Directory

Sourav Gulati
Site Owner
Posts: 83

Import Data from Local Directory:

hive>LOAD DATA LOCAL INPATH '/local/path' OVERWRITE INTO TABLE table-name;

OVERWRITE is optional in latest versions of hive . You can exclude it if you want to  append data in table.


Export Data to Local Directory:

hive>INSERT OVERWRITE LOCAL DIRECTORY '/local dir/path' SELECT * from table-name;


Import Data from HDFS  :

hive>LOAD DATA INPATH '/hdfs/path/to/file' OVERWRITE INTO TABLE tablename;

OVERWRITE is optional in latest versions of hive . You can exclude it if you want to  append data in table.


Export Data to HDFS:

hive>INSERT OVERWRITE DIRECTORY  /path/to/hdfs' SELECT * FROM tablename;

 



Click here for Other topics of BigData Technologies

 

 

February 22, 2013 at 12:58 PM Flag Quote & Reply

siegfried
Member
Posts: 1

hello sourav-

I used this query but the problem here is we are getting number of files along with CRC file.

hive>INSERT OVERWRITE LOCAL DIRECTORY '/local dir/path' SELECT * from table-name;


How can I create one file from Hive with incremental extraction.



May 15, 2013 at 8:17 AM Flag Quote & Reply

vinay
Member
Posts: 1

How user interface will connected to Hadoop.I am using play framework user interface to connect HDFS.Plz explain java code doing this work simpler

June 26, 2013 at 12:50 PM Flag Quote & Reply

Sourav Gulati
Site Owner
Posts: 83

Hi Vinay,

I apologize for very late reply. I lost touch with this website

Please use Hive Client for running Hive Queries from Java. Please refer following URL:

https://cwiki.apache.org/confluence/display/Hive/HiveClient


--


February 14, 2014 at 12:52 PM Flag Quote & Reply

Sourav Gulati
Site Owner
Posts: 83

Hi Siegfried,

I apologize for very late reply. I lost touch with this website

If you are facing some issue, please post your query , I will surely reply

--


February 14, 2014 at 12:54 PM Flag Quote & Reply

You must login to post.