When doing an INSERT OVERWRITE LOCAL DI开发者_如何转开发RECTORY
is it possible to specify the delimiter to use?
For Columns, Collections, Maps, Arrays... The whole gambit of delimiter uses.
A document or such that shows how to implement would be super best fantastic. :)
A simple way is to use concat and only one field if the default line delimiter \n suits you :
INSERT OVERWRITE LOCAL DIRECTORY 'output' SELECT concat(coalesce(field1,''),'\;', coalesce(field2,''),'\;', coalesce(field3,''),'\;', coalesce(field4,'')) FROM MyTable;
that way you won't have default \001 field delimiters.
There's a ticket for this on the Hive Jira. See https://issues.apache.org/jira/browse/HIVE-634.
use a query like
INSERT OVERWRITE LOCAL DIRECTORY '/home/sumit/POC/code/UseCase1' select day, " ",
count(distinct(feature)) from Table_Day_Feature group by day order by day;
to insert a " " between the columns
精彩评论