<?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: convert orc table data into csv in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232704#M70201</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;&lt;P&gt;I am trying to use hive -e "select ,, * to txt but after logging initiliazed nothing is happening:&lt;/P&gt;&lt;P&gt;Logging initialized using configuration in file:/etc/hive/2.5.3.0-37/0/hive-log4j.properties &lt;/P&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;Is it because of the size of the table?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2017 04:13:06 GMT</pubDate>
    <dc:creator>pmj</dc:creator>
    <dc:date>2017-10-25T04:13:06Z</dc:date>
    <item>
      <title>convert orc table data into csv</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232700#M70197</link>
      <description>&lt;P&gt;I have a text data(.csv) file in hive external table. I am planning to use orc compression on the text data by creating a new orc table (the compression rate is more than 10 x times better...) and then i would like to delete the external tables csv file. In some cases if i want to convert the ORC table back into csv file, what is the easiest way to do it? i cannot do it directly when i do hive -e "select ... from orc table" &amp;gt;&amp;gt; /tmp/csvfile, it is just stuck.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:26:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232700#M70197</guid>
      <dc:creator>pmj</dc:creator>
      <dc:date>2022-09-16T12:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: convert orc table data into csv</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232701#M70198</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/14451/pjalleda.html" nodeid="14451"&gt;@PJ&lt;/A&gt;&lt;P&gt;Give a try to download as csv from Ambari View or Hue?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 02:04:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232701#M70198</guid>
      <dc:creator>divakarreddy_a</dc:creator>
      <dc:date>2017-10-25T02:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: convert orc table data into csv</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232702#M70199</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2348/divakarreddya.html" nodeid="2348"&gt;@Divakar Annapureddy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have data hourly with about 9+ million rows, firstly it is taking a lot of time to download it to csv from ambari view and secondly it is only exporting 47K+ rows into csv .. not sure why&lt;/P&gt;&lt;P&gt;Is there any better way ?&lt;/P&gt;&lt;P&gt;Also, what are some pros and cons of converting a text file to orc in terms of joins and anything else that is to be noted?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 02:36:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232702#M70199</guid>
      <dc:creator>pmj</dc:creator>
      <dc:date>2017-10-25T02:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: convert orc table data into csv</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232703#M70200</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14451/pjalleda.html" nodeid="14451"&gt;@PJ&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;When you are having huge data in orc table then it will take a while to convert all the results and store them as csv file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Here is what i tried:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;foo is an orc table&lt;/P&gt;&lt;PRE&gt;hive#select * from foo;
+---------+--+
| foo.id  |
+---------+--+
| 1       |
| 2       |
| 3       |
| 4       |
+---------+--+&lt;/PRE&gt;
&lt;PRE&gt;bash#hive-e "select * from foo1"&amp;gt;&amp;gt;foo1.txt&lt;/PRE&gt;
&lt;PRE&gt;bash# cat foo1.txt
+----------+--+
| foo1.id  |
+----------+--+
| 1        |
| 2        |
| 3        |
| 4        |
+----------+--+&lt;/PRE&gt;&lt;P&gt;When we are having small set of data it will be done very quickly.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if the number of records are really big &lt;/STRONG&gt;then Ideal way to do this is as follows&lt;/P&gt;&lt;PRE&gt;hive#INSERT OVERWRITE DIRECTORY '&amp;lt;Hdfs-Directory-Path&amp;gt;'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
SELECT * FROM default.foo;&lt;/PRE&gt;&lt;P&gt;or else you can write the data to &lt;STRONG&gt;local directories&lt;/STRONG&gt; also just add local &lt;/P&gt;&lt;PRE&gt;hive#INSERT OVERWRITE LOCAL DIRECTORY '&amp;lt;Local-Dir-Path&amp;gt;'
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
SELECT * FROM default.foo;&lt;/PRE&gt;&lt;P&gt;Also, note that the insert overwrite directory basically&lt;STRONG&gt; removes all the existing files&lt;/STRONG&gt; under the specified folder and then create data files as part files and this may &lt;STRONG&gt;create multiple files&lt;/STRONG&gt; and you may want to &lt;STRONG&gt;concatenate them&lt;/STRONG&gt; on the client side after it's done exporting.&lt;/P&gt;&lt;P&gt;Using this approach means you &lt;STRONG&gt;don't need to worry&lt;/STRONG&gt; about the format of the source tables, can select your own delimiters and output formats.&lt;/P&gt;&lt;P&gt;** I would suggest try to avoid &lt;STRONG&gt;saving large file&lt;/STRONG&gt; to&lt;STRONG&gt; local directory&lt;/STRONG&gt; if possible, Use insert overwrite directory and store the results to &lt;STRONG&gt;HDFS directory&lt;/STRONG&gt; **&lt;/P&gt;&lt;P&gt;For more details refer to this link.&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingdataintoHiveTablesfromqueries" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DML#LanguageManualDML-InsertingdataintoHiveTablesfromqueries&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 02:38:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232703#M70200</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-10-25T02:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: convert orc table data into csv</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232704#M70201</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;&lt;P&gt;I am trying to use hive -e "select ,, * to txt but after logging initiliazed nothing is happening:&lt;/P&gt;&lt;P&gt;Logging initialized using configuration in file:/etc/hive/2.5.3.0-37/0/hive-log4j.properties &lt;/P&gt;&lt;P&gt;OK&lt;/P&gt;&lt;P&gt;Is it because of the size of the table?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 04:13:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232704#M70201</guid>
      <dc:creator>pmj</dc:creator>
      <dc:date>2017-10-25T04:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: convert orc table data into csv</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232705#M70202</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/14451/pjalleda.html" nodeid="14451"&gt;@PJ&lt;/A&gt;&lt;P&gt;Yeah, it might be that case.Because if you are having&lt;STRONG&gt; large number of records&lt;/STRONG&gt; then it will take a lot of time to convert ORC data to csv format and if you &lt;STRONG&gt;compare&lt;/STRONG&gt; these two process executing query with&lt;STRONG&gt; insert overwrite directory&lt;/STRONG&gt; will &lt;STRONG&gt;perform&lt;/STRONG&gt; much &lt;STRONG&gt;faster with no issues&lt;/STRONG&gt; and also we can keep &lt;STRONG&gt;what ever delimiter&lt;/STRONG&gt; &lt;STRONG&gt;we need&lt;/STRONG&gt; and we don't need to&lt;STRONG&gt; worry about size of the data&lt;/STRONG&gt;. &lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2017 10:41:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/convert-orc-table-data-into-csv/m-p/232705#M70202</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2017-10-25T10:41:44Z</dc:date>
    </item>
  </channel>
</rss>

