Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does 'insert overwrite local directory' mean in Hive?

Tags:

hive

hiveql

Im having some issues understanding what does the following type of query do:

insert overwrite local directory $directorey_name$ select $some_query$

What does this mean, and what are the side effects of this?

like image 305
frmsaul Avatar asked Mar 14 '17 17:03

frmsaul


1 Answers

Export the query results into a file on the local file system

insert overwrite local directory '/tmp/hello'
row format delimited
fields terminated by '|'
select 1,2,3,'Hello','world'
;

! ls /tmp/hello;
000000_0
! cat /tmp/hello/000000_0;
1|2|3|Hello|world
like image 152
David דודו Markovitz Avatar answered Oct 23 '22 15:10

David דודו Markovitz