title: Export as csv in beeline hive
body: <p>I am trying to export my hive table as a csv in beeline hive. When I run the command <code>!sql select * from database1 &gt; /user/bob/output.csv</code> it gives me syntax error.</p>
  
  <p>I have successfully connected to the database at this point using the below command. The query outputs the correct results on console.</p>
  
  <pre><code>beeline -u 'jdbc:hive2://[databaseaddress]' --outputformat=csv
  </code></pre>
  
  <p>Also, not very clear where the file ends up. It should be the file path in hdfs correct?</p>