Created 10-14-2024 02:37 AM
Hello Team,
can we import/export hive table to s3 location or nfs share ? as per what i searched it is only supported for hdfs location. can you please help me to know if we can do it and if yes how can we achieve it ?
Created 10-22-2024 04:07 AM
Unfortunately there is no compression setting for the Hive Export. This feature was introduced when Hive CLI was used in the HDP days of Hortonworks.
You will need to create your tables with compression enabled, and in your case you will need to either do one of the following.
Alter the table and add compression to the table properties, and then do an insert overwrite to the table to compress it.
Or create a new table with compression added to the table properties, and then insert the data from the old table into the new one.
I would recommend using the Snappy Compression.
Created 10-16-2024 01:37 PM
Unfortunately the Hive Import/Export is only supported for HDFS. The only method I know of to get the table and data into S3 is as follows, see example below.
You need to create a table that is mapped onto S3 bucket and directory
CREATE TABLE tests3 (
id BIGINT, time STRING, log STRING
)
row format delimited fields terminated by ','
lines terminated by '\n'
STORED AS TEXTFILE
LOCATION 's3n://bucket/directory/';
Insert data into s3 table and when the insert is complete the directory will have a csv file
INSERT OVERWRITE TABLE tests3
select id, time, log
from testcsvimport;
Created 10-17-2024 11:20 PM
Thanks for the help.
Also have a doubt can we export the data to hdfs in compressed format i.e., into zip file or something else
Created 10-18-2024 05:47 AM
Please see the accepted compression formats supported below.
When exporting in hive it will compress the data.
Created on 10-20-2024 11:30 PM - edited 10-20-2024 11:35 PM
Hi @MGreen ,
i am unable to find how to pass which type of format we want the export to get dumped.
is it using beeline if yes can you please help me with the command or the argument to pass to export in compress format.
since today when i run export command the data size of table and data size of exported data approximately same.
Created 10-22-2024 04:07 AM
Unfortunately there is no compression setting for the Hive Export. This feature was introduced when Hive CLI was used in the HDP days of Hortonworks.
You will need to create your tables with compression enabled, and in your case you will need to either do one of the following.
Alter the table and add compression to the table properties, and then do an insert overwrite to the table to compress it.
Or create a new table with compression added to the table properties, and then insert the data from the old table into the new one.
I would recommend using the Snappy Compression.
Created 10-22-2024 04:10 AM
Thanks @MGreen for the help