title: Export Hive Query Results
body: <p>I'm new to <code>hive</code> and could use some tips.</p>
  
  <p>I'm trying to export query results from <code>hive</code> as a <code>csv</code>.  When I try to pipe them out of CLI like:</p>
  
  <pre><code>hive -e 'select * from table'&gt;OutPut.txt
  </code></pre>
  
  <p>I get a text file that has all the records but doesn't have the column headers.  Does anyone have a tip for how to export the query results with the column headers, to a <code>csv</code> file?</p>
  
  <p>If I run the query in hue, and then download the results as a <code>csv</code> I get a <code>csv</code> with the column headers but no records.  If anyone has a tip on how to download query results from hue with records and column headers, I would greatly appreciate it too.</p>