The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

Hortonworks Sandbox Forum

UDF for pig not working

  • #17869

    i have created a UDF jar for use with pig with HDP VM on virtualbox.
    uploaded it using ‘select udf jar’ button on sandbox ui and clicked ‘add’.
    the statement – register ‘myudf.jar’; is generating following error
    2013-03-15 03:00:48,476 [main] INFO org.apache.pig.Main – Apache Pig version (rexported) compiled Jan 10 2013, 04:00:42
    2013-03-15 03:00:48,476 [main] INFO org.apache.pig.Main – Logging error messages to: /home/sandbox/hue/pig_1363341648473.log
    2013-03-15 03:00:48,916 [main] INFO org.apache.pig.backend.hadoop.executionengine.HExecutionEngine – Connecting to hadoop file system at: file:///
    2013-03-15 03:00:49,817 [main] ERROR – ERROR 2997: Encountered IOException. File does not exist: hdfs://sandbox:8020/tmp/udfs/’myudf.jar’
    Details at logfile: /home/sandbox/hue/pig_1363341648473.log

    however the file exists in the /tmp/udfs/ location.
    what could be the reason behind this? and how to resolve it?

  • Author
  • #17876

    Hi Pranjal,

    Thanks for trying the Hortonworks Sandbox.
    Check the persmissions on the UDF file, is it world readable? If not this could be the reason that Pig claims it is not there.


    Peter Rudenko

    You have an error in your register statement. You can click on UDF jar and it will automatically register or use next statement (without quotes and semicolon)
    register myudf.jar


    many thanks for the response.
    i figured this ‘without quote’ thingy a while ago on my own.
    although the quotes were my mistake but it was taking too long to get community help on this. hence i switched back to bare bones pig and hadoop installations on ubuntu, instead of banging my head against HDP vm.
    however the IOException is ridiculously misleading.

    thanks peter and tedr.

The forum ‘Hortonworks Sandbox’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.