Reputation: 3327
I can export a hive query results using this:
INSERT OVERWRITE LOCAL DIRECTORY '/home/user/events/'
but if I want to export it to an HDFS dir at /user/events/
how do I do that? I tried this:
INSERT OVERWRITE DIRECTORY '/user/user/events/'
> row format delimited
> fields terminated by '\t'
> select * from table;
but get this error then:
FAILED: ParseException line 2:0 cannot recognize input near 'row' 'format' 'delimited' in statement
Upvotes: 0
Views: 119
Reputation: 1081
remove the LOCAL
keyword - it specifies local filesystem. Without it the result will go to hdfs. You may actually need to use OVERWRITE
though. So:
INSERT OVERWRITE DIRECTORY '/user/events/'
Upvotes: 1