<?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 Best practice for extract/output data (generated by Pig script) to be stored in a single file? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-practice-for-extract-output-data-generated-by-Pig/m-p/98427#M11847</link>
    <description>&lt;P&gt;AIM: To grab a daily extract of data stored in HDFS/Hive, process it using Pig, then make results available externally as a single CSV file (automated using bash script).&lt;/P&gt;&lt;P&gt;OPTIONS:&lt;/P&gt;&lt;P&gt;1. Force output from Pig script to be stored as one file using 'PARALLEL 1' and then copy out using '-copyToLocal'&lt;/P&gt;&lt;PRE&gt;extractAlias = ORDER stuff BY something ASC;
STORE extractAlias INTO '/hdfs/output/path' USING CSVExcelStorage() PARALLEL 1;&lt;/PRE&gt;&lt;P&gt;2. Allow default parallelism during Pig STORE and use '-getmerge' when copying out extract results&lt;/P&gt;&lt;PRE&gt;hdfs dfs -getmerge '/hdfs/output/path' '/local/dest/path'&lt;/PRE&gt;&lt;P&gt;QUESTION:&lt;/P&gt;&lt;P&gt;Which way is more efficient/practical and why? Are there any other ways?&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2015 14:11:19 GMT</pubDate>
    <dc:creator>emilysharpe</dc:creator>
    <dc:date>2015-12-10T14:11:19Z</dc:date>
    <item>
      <title>Best practice for extract/output data (generated by Pig script) to be stored in a single file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-practice-for-extract-output-data-generated-by-Pig/m-p/98427#M11847</link>
      <description>&lt;P&gt;AIM: To grab a daily extract of data stored in HDFS/Hive, process it using Pig, then make results available externally as a single CSV file (automated using bash script).&lt;/P&gt;&lt;P&gt;OPTIONS:&lt;/P&gt;&lt;P&gt;1. Force output from Pig script to be stored as one file using 'PARALLEL 1' and then copy out using '-copyToLocal'&lt;/P&gt;&lt;PRE&gt;extractAlias = ORDER stuff BY something ASC;
STORE extractAlias INTO '/hdfs/output/path' USING CSVExcelStorage() PARALLEL 1;&lt;/PRE&gt;&lt;P&gt;2. Allow default parallelism during Pig STORE and use '-getmerge' when copying out extract results&lt;/P&gt;&lt;PRE&gt;hdfs dfs -getmerge '/hdfs/output/path' '/local/dest/path'&lt;/PRE&gt;&lt;P&gt;QUESTION:&lt;/P&gt;&lt;P&gt;Which way is more efficient/practical and why? Are there any other ways?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 14:11:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-practice-for-extract-output-data-generated-by-Pig/m-p/98427#M11847</guid>
      <dc:creator>emilysharpe</dc:creator>
      <dc:date>2015-12-10T14:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Best practice for extract/output data (generated by Pig script) to be stored in a single file?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-practice-for-extract-output-data-generated-by-Pig/m-p/98428#M11848</link>
      <description>&lt;P&gt;I believe generally hard coding parallel is a bad idea in your pig script.  With Parallel 1, you are effectively having 1 reducer perform the job.  This can affect scale and performance.&lt;/P&gt;&lt;P&gt;I would allow default parallelism and use the hdfs dfs -getmerge option.

For an input point of view, Here is a tip to &lt;A href="http://pig.apache.org/docs/r0.10.0/perf.html#combine-files"&gt;Combine Small files.&lt;/A&gt;
&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 23:08:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Best-practice-for-extract-output-data-generated-by-Pig/m-p/98428#M11848</guid>
      <dc:creator>amcbarnett</dc:creator>
      <dc:date>2015-12-10T23:08:11Z</dc:date>
    </item>
  </channel>
</rss>

