Save results of a query in csv - Hortonworks Hive

Asked

Viewed 41 times

1

Please, I tried the code below on Hive 1.2.1000.2.6.5.0-292 and there was an error. How can I extract data from a query in a csv without creating a table?

hive --e 'select * from product limit 10;' | sed 's/[[:space:]]\+/,/g' > ~/output.csv;

Error:

FAILED: ParseException line 1:0 cannot recognize input near 'hive' '<EOF>' '<EOF>'   

1 answer

0

The command is correct.

The host you are accessing has the Hive client installed?

What you can also do is to enter Hive and make a local directory, as in the example below. It will save the result on the linux host q vc is connected.

If you prefer a graphical interface to do this, you can install dbeaver (https://dbeaver.io/download/)

insert overwrite local directory '/tmp/output' 
select * from product limit 10;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.