<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: how to download hive data into csv format in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59614#M67649</link>
    <description>&lt;P&gt;if you have hive shell or beeline - you can excute the same code nothing different&amp;nbsp;&lt;/P&gt;&lt;P&gt;or you can try hue web ui to export the hive results as .csv&amp;nbsp;&lt;/P&gt;&lt;P&gt;althought hue is not that good in downloading big tables .&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Sep 2017 08:08:35 GMT</pubDate>
    <dc:creator>csguna</dc:creator>
    <dc:date>2017-09-06T08:08:35Z</dc:date>
    <item>
      <title>how to download hive data into csv format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59591#M67648</link>
      <description>&lt;PRE&gt;I have created tables in hive, now i would like to download those tables in csv format,  i have searched online, so i got these below solutions, but i dont understand how to use these commands on cloudera.
1.
hive -e 'select books from table' | sed 's/[[:space:]]\+/,/g' &amp;gt; /home/lvermeer/temp.csv
 
2.
set hive.io.output.fileformat = CSVTextFile;

INSERT OVERWRITE LOCAL DIRECTORY 'dir_path' SELECT FIELD1, FIELD2, FIELD3 FROM TABLE1;

If anyone knows, kindly help me out.

Thanks in advance.&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:11:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59591#M67648</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2022-09-16T12:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to download hive data into csv format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59614#M67649</link>
      <description>&lt;P&gt;if you have hive shell or beeline - you can excute the same code nothing different&amp;nbsp;&lt;/P&gt;&lt;P&gt;or you can try hue web ui to export the hive results as .csv&amp;nbsp;&lt;/P&gt;&lt;P&gt;althought hue is not that good in downloading big tables .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Sep 2017 08:08:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59614#M67649</guid>
      <dc:creator>csguna</dc:creator>
      <dc:date>2017-09-06T08:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to download hive data into csv format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59750#M67650</link>
      <description>&lt;P&gt;You can try this as well in Unix.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;beeline - u 'your jdbc connection string' - - outputformat=csv2 -e "your query here" &amp;gt; output.csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know if it helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Manu&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2017 04:27:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/59750#M67650</guid>
      <dc:creator>manuspark3</dc:creator>
      <dc:date>2017-09-10T04:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to download hive data into csv format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/66059#M67651</link>
      <description>&lt;P&gt;I have finally found a way to do that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;insert overwrite local directory 'Desktop/svk1.csv'
    &amp;gt; row format delimited
    &amp;gt; fields terminated by ','
    &amp;gt; select * from emp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then open the directory, just rename the file with .csv extension.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Apr 2018 09:58:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/66059#M67651</guid>
      <dc:creator>saisvk</dc:creator>
      <dc:date>2018-04-05T09:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to download hive data into csv format</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/86853#M67652</link>
      <description>&lt;P&gt;In case you are doing it from Windows you can use Python script&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/hive-scripts/hivehoney/blob/master/hh.py" target="_blank" rel="nofollow noreferrer"&gt;hivehoney&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to extract table data to local CSV file.&lt;/P&gt;&lt;P&gt;It will:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Login to bastion host.&lt;/LI&gt;&lt;LI&gt;pbrun.&lt;/LI&gt;&lt;LI&gt;kinit.&lt;/LI&gt;&lt;LI&gt;beeline (with your query).&lt;/LI&gt;&lt;LI&gt;Save echo from beeline to a file on Windows.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Execute it like this:&lt;/P&gt;&lt;PRE&gt;set PROXY_HOST=your_bastion_host

set SERVICE_USER=you_func_user

set LINUX_USER=your_SOID

set LINUX_PWD=your_pwd

python hh.py --query_file=query.sql&lt;/PRE&gt;</description>
      <pubDate>Sun, 24 Feb 2019 13:59:02 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/how-to-download-hive-data-into-csv-format/m-p/86853#M67652</guid>
      <dc:creator>alexB</dc:creator>
      <dc:date>2019-02-24T13:59:02Z</dc:date>
    </item>
  </channel>
</rss>

