<?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: hcat.bin is not defined. Define it to be your hcat script in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95869#M9263</link>
    <description>&lt;P&gt;I see it's thrown from this class &lt;A href="https://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java" target="_blank"&gt;https://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Oct 2015 08:52:07 GMT</pubDate>
    <dc:creator>aervits</dc:creator>
    <dc:date>2015-10-23T08:52:07Z</dc:date>
    <item>
      <title>hcat.bin is not defined. Define it to be your hcat script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95868#M9262</link>
      <description>&lt;P&gt;getting error when executing a pig script through Oozie. Script has pig and hcat commands.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 08:49:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95868#M9262</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-10-23T08:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: hcat.bin is not defined. Define it to be your hcat script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95869#M9263</link>
      <description>&lt;P&gt;I see it's thrown from this class &lt;A href="https://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java" target="_blank"&gt;https://svn.apache.org/repos/asf/pig/trunk/src/org/apache/pig/tools/grunt/GruntParser.java&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 08:52:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95869#M9263</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-10-23T08:52:07Z</dc:date>
    </item>
    <item>
      <title>Re: hcat.bin is not defined. Define it to be your hcat script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95870#M9264</link>
      <description>&lt;P&gt;do I need to set $HCAT_HOME/bin/hcat in pig.properties?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 08:55:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95870#M9264</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-10-23T08:55:46Z</dc:date>
    </item>
    <item>
      <title>Re: hcat.bin is not defined. Define it to be your hcat script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95871#M9265</link>
      <description>&lt;P&gt;That should work I think.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 09:09:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95871#M9265</guid>
      <dc:creator>deepesh1</dc:creator>
      <dc:date>2015-10-23T09:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: hcat.bin is not defined. Define it to be your hcat script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95872#M9266</link>
      <description>&lt;P&gt;&lt;STRONG&gt;SOLUTION&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Pig introduced an option to run hcatalog commands in grunt and in scripts. There's more info in pig.properties file in /etc/pig/conf/pig.properties&lt;/P&gt;&lt;P&gt;# In addition to the fs-style commands (rm, ls, etc) Pig can now execute &lt;/P&gt;&lt;P&gt;# SQL-style DDL commands, eg "sql create table pig_test(name string, age int)". &lt;/P&gt;&lt;P&gt;# The only implemented backend is hcat, and luckily that's also the default. &lt;/P&gt;&lt;P&gt;# &lt;/P&gt;&lt;P&gt;# pig.sql.type=hcat
# Path to the hcat executable, for use with pig.sql.type=hcat (default: null) &lt;/P&gt;&lt;P&gt;# &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;hcat.bin=/usr/local/hcat/bin/hcat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;this is on sandbox 2.3, HDP 2.3 and HDP 2.3.2 by default&lt;/P&gt;&lt;P&gt;so running any pig script with hcat commands without -useHCatalog will fail with the following, usually that will happen through Oozie&lt;/P&gt;&lt;P&gt;Pig Stack Trace
---------------
ERROR 2997: Encountered IOException. /usr/local/hcat/bin/hcat does not exist. Please check your 'hcat.bin' setting in pig.properties.
java.io.IOException: /usr/local/hcat/bin/hcat does not exist. Please check your 'hcat.bin' setting in pig.properties.
        at org.apache.pig.tools.grunt.GruntParser.processSQLCommand(GruntParser.java:1286)
        at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:501)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:230)
        at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:205)
        at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:81)
        at org.apache.pig.Main.run(Main.java:631)
        at org.apache.pig.Main.main(Main.java:177)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
        at org.apache.hadoop.util.RunJar.main(RunJar.java:136)&lt;/P&gt;&lt;P&gt;so to fix it change it globally by editing pig.properties in Ambari to point to the following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;hcat.bin=/usr/bin/hcat&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;copy pig.properties to your own location, override the pig.properties with right path (i.e. hcat.bin=/usr/bin/hcat) and execute script like so&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pig -P pig.properties test.pig&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;override the property on the fly&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pig -Dhcat.bin=/usr/bin/hcat test.pig&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Or even lesser intrusive way:&lt;/P&gt;&lt;P&gt;In your pig script put this in the beginning&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set hcat.bin /usr/bin/hcat;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 21:19:31 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/hcat-bin-is-not-defined-Define-it-to-be-your-hcat-script/m-p/95872#M9266</guid>
      <dc:creator>aervits</dc:creator>
      <dc:date>2015-10-23T21:19:31Z</dc:date>
    </item>
  </channel>
</rss>

