Hive: how to execute a request from a file and upload output to hdfs

I can execute a query from sql file and save the output in a local file with

hive -f /home/Prashasti/test.sql > /home/Prashasti/output.csv

In addition, I can save the output of the bush request in hdfs using:

insert overwrite directory 'user/output' select * from folders;

Is it possible to run a query from a sql file and save the output in hdfs?

+4
source share
1 answer

Just modify the sql file and add insert overwrite directory 'user/output'to the beginning of the query.

+2
source

All Articles