title: Using Pig on Hortonworks Sandbox
body: <p>I've been trying to use CurrentTime() on the sandbox provided by Hortonworks and can't get it to work.</p>
  
  <p>This is all I have in the Pig script:</p>
  
  <pre><code>&lt;code&gt;
  REGISTER zookeeper.jar
  REGISTER piggybank.jar
  REGISTER hbase-common-0.98.4.2.2.0.0-2041-hadoop2.jar
  REGISTER hbase-common-0.98.4.2.2.0.0-2041-hadoop2-tests.jar
  REGISTER hbase-client-0.98.4.2.2.0.0-2041-hadoop2.jar
  REGISTER guava.jar
  a = CurrentTime();
  dump a;
  &lt;/code&gt;
  </code></pre>
  
  <p>The error I see in the logs say: </p>
  
  <pre><code>15/04/13 21:23:22 INFO pig.ExecTypeProvider: Trying ExecType : LOCAL
  15/04/13 21:23:22 INFO pig.ExecTypeProvider: Trying ExecType : MAPREDUCE
  15/04/13 21:23:22 INFO pig.ExecTypeProvider: Picked MAPREDUCE as the ExecType
  2015-04-13 21:23:22,428 [main] INFO  org.apache.pig.Main - Apache Pig version 0.14.0.2.2.0.0-2041 (rexported) compiled Nov 19 2014, 15:24:46
  2015-04-13 21:23:22,429 [main] INFO  org.apache.pig.Main - Logging error messages to: /hadoop/yarn/local/usercache/hue/appcache/application_1428957295391_0006/container_1428957295391_0006_01_000002/pig_1428960202427.log
  2015-04-13 21:23:24,041 [main] INFO  org.apache.pig.impl.util.Utils - Default bootup file /home/yarn/.pigbootup not found
  2015-04-13 21:23:24,615 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: hdfs://sandbox.hortonworks.com:8020
  2015-04-13 21:23:27,864 [main] ERROR org.apache.pig.PigServer - exception during parsing: Error during parsing. &lt;file script.pig, line 10&gt; Cannot expand macro 'CurrentTime'. Reason: Macro must be defined before expansion.
  Failed to parse: &lt;file script.pig, line 10&gt; Cannot expand macro 'CurrentTime'. Reason: Macro must be defined before expansion.
      at org.apache.pig.parser.PigMacro.macroInline(PigMacro.java:455)
      at org.apache.pig.parser.QueryParserDriver.inlineMacro(QueryParserDriver.java:301)
      at org.apache.pig.parser.QueryParserDriver.expandMacro(QueryParserDriver.java:290)
      at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:183)
      at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1735)
      at org.apache.pig.PigServer$Graph.access$000(PigServer.java:1443)
      at org.apache.pig.PigServer.parseAndBuild(PigServer.java:387)
      at org.apache.pig.PigServer.executeBatch(PigServer.java:412)
      at org.apache.pig.PigServer.executeBatch(PigServer.java:398)
      at org.apache.pig.tools.grunt.GruntParser.executeBatch(GruntParser.java:171)
      at org.apache.pig.tools.grunt.GruntParser.processDump(GruntParser.java:741)
      at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:372)
      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:495)
      at org.apache.pig.Main.main(Main.java:170)
      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)
  2015-04-13 21:23:27,871 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200: &lt;file script.pig, line 10&gt; Cannot expand macro 'CurrentTime'. Reason: Macro must be defined before expansion.
  Details at logfile: /hadoop/yarn/local/usercache/hue/appcache/application_1428957295391_0006/container_1428957295391_0006_01_000002/pig_1428960202427.log
  2015-04-13 21:23:27,908 [main] INFO  org.apache.pig.Main - Pig script completed in 5 seconds and 684 milliseconds (5684 ms)
  </code></pre>
  
  <p>I included those register lines since I thought maybe the UDFs weren't somehow included. I have no idea what to do now</p>