how to export hive into a csv or txt in a big data, the data are more than 10000, and i use hue browser to export it.
i already tried insert overwrite local directory code, but it didn't work
how to export hive into a csv or txt in a big data, the data are more than 10000, and i use hue browser to export it.
i already tried insert overwrite local directory code, but it didn't work
INSERT OVERWRITE LOCAL DIRECTORY '/tmp/dir/file1'
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
SELECT * from tablename;
come out of hive cli
go to this /tmp/dir/ location
cat file1/* > file1.csv
zip file1 file1.csv
winscp it to windows and enjoy :)
You can query your data from the command line as such:
hive -e 'select x from table1' > /your/directory/data.csv
Refer to this solution for more info: