Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How can I save my query results in HDFS file in a single file

Highlighted

How can I save my query results in HDFS file in a single file

Explorer

HI,

I am running the following query to write my select query o/p into a HDFS location. But ot creating multiple part file rather 1 single part file. Please let me know how would I create a single o/p file from this Select statement. Also let me know is there any other efficient way to save query results into a file , redirecting the SQL output using beeline or hive is having info and log detail. I just wanted to store the query o/p results only.

 

 insert overwrite directory '/user/hive/warehouse/plane'
STORED as TEXTFILE
select * from planes distribute by ( tailnum);

Don't have an account?
Coming from Hortonworks? Activate your account here