You can export a hive table to S3 in a single file using the following code snippet.
set mapred.reduce.tasks = 1; insert overwrite directory 's3a://my-bucket/my_filename' row format delimited fields terminated by ',' select * from mytable order by column_a; set mapred.reduce.tasks = -1;
Note that we used the order by
statement in order to force a single reducer since we didn’t; have any other “reduce” operation like “group by” and so on.