<?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: Does anyone have example code of how to use the MR input format to call a python script? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94481#M7777</link>
    <description>&lt;P&gt;Thanks for the response but, unfortunately, this won't work because we need to wrap a Hive table over the source files. &lt;/P&gt;</description>
    <pubDate>Tue, 06 Oct 2015 19:31:36 GMT</pubDate>
    <dc:creator>SQLShaw</dc:creator>
    <dc:date>2015-10-06T19:31:36Z</dc:date>
    <item>
      <title>Does anyone have example code of how to use the MR input format to call a python script?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94479#M7775</link>
      <description />
      <pubDate>Tue, 29 Sep 2015 19:38:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94479#M7775</guid>
      <dc:creator>SQLShaw</dc:creator>
      <dc:date>2015-09-29T19:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have example code of how to use the MR input format to call a python script?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94480#M7776</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/186/sshaw.html" nodeid="186"&gt;@sshaw@hortonworks.com&lt;/A&gt;&lt;P&gt;In this scenario your best bet is going to be to use MR-Streaming. MR-Streaming will read the data from the files in HDFS and present each InputRecord (I'm assuming TextInputFormat line delimited so each line of the file in that case) to your python script to execute. This is handy in your scenario because this keeps you from having to invoke python scripts from the native Java MR code. &lt;A href="https://github.com/jdye64/Simple-MR-Streaming"&gt;Here&lt;/A&gt; is a really simple example. You can adjust the 'map.py' file to contain any logic you desire or even use subprocess to call an existing python script it desired.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 20:42:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94480#M7776</guid>
      <dc:creator>jdyer</dc:creator>
      <dc:date>2015-09-29T20:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have example code of how to use the MR input format to call a python script?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94481#M7777</link>
      <description>&lt;P&gt;Thanks for the response but, unfortunately, this won't work because we need to wrap a Hive table over the source files. &lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2015 19:31:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94481#M7777</guid>
      <dc:creator>SQLShaw</dc:creator>
      <dc:date>2015-10-06T19:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have example code of how to use the MR input format to call a python script?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94482#M7778</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/186/sshaw.html" nodeid="186"&gt;@Scott Shaw&lt;/A&gt;&lt;P&gt;What about Hive transform calling your python code? You can use whatever input format you want in your hive table.&lt;/P&gt;&lt;P&gt;A simple code here:&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://andreyfradkin.com/posts/2013/06/15/combining-hive-and-python/"&gt;http://andreyfradkin.com/posts/2013/06/15/combining-hive-and-python/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;a more detailed example (but using R instead of python):&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://hortonworks.com/blog/using-r-and-other-non-java-languages-in-mapreduce-and-hive/"&gt;http://hortonworks.com/blog/using-r-and-other-non-java-languages-in-mapreduce-and-hive/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but you can also use map/reduce paradigm if you use distribute by clauses. &lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 07:44:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94482#M7778</guid>
      <dc:creator>gbraccialli3</dc:creator>
      <dc:date>2015-11-27T07:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: Does anyone have example code of how to use the MR input format to call a python script?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94483#M7779</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/186/sshaw.html" nodeid="186"&gt;@Scott Shaw&lt;/A&gt; are you still having issues with this? Can you accept best answer or provide your own solution?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 23:52:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-anyone-have-example-code-of-how-to-use-the-MR-input/m-p/94483#M7779</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2016-02-03T23:52:44Z</dc:date>
    </item>
  </channel>
</rss>

