Pig
  1. Pig
  2. PIG-183

Pig could not resolve my udf class

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.1.0
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      When I ran the following Pig script with the latest Pig stuff, I got an exception for unresolved class. I noticed that org.apache.pig.test.udf.storefunc is not among the packages that Pig searches ([, org.apache.pig.builtin., com.yahoo.pig.yst.sds.ULT., org.apache.pig.impl.builtin.]).

      I am sure that the package path for StringStore (org.apache.pig.test.udf.storefunc) is correct in testudf.jar. I attached testudf.jar here with this bug report.

      register /path/to/my/jar/testudf.jar;
      A = load '/user/pig/tests/data/singlefile/textdoc' using org.apache.pig.test.udf.storefunc.StringStore();
      store A into 'results_4_1';
      
      2008-04-03 13:20:25,154 [main] INFO  org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to hadoop file system at: wilbur11.labs.corp.sp1.yahoo.com:8020
      2008-04-03 13:20:25,781 [main] ERROR org.apache.pig.tools.grunt.Grunt - java.lang.RuntimeException: could not instantiate 'org.apache.pig.test.udf.storefunc.StringStore' with arguments '[]'
              at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:504)
              at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:510)
              at org.apache.pig.impl.io.ValidatingInputFileSpec.getSlicer(ValidatingInputFileSpec.java:50)
              at org.apache.pig.impl.io.ValidatingInputFileSpec.validate(ValidatingInputFileSpec.java:42)
              at org.apache.pig.impl.io.ValidatingInputFileSpec.<init>(ValidatingInputFileSpec.java:37)
              at org.apache.pig.impl.logicalLayer.parser.QueryParser.LoadClause(QueryParser.java:795)
              at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:628)
              at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:484)
              at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:334)
              at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:47)
              at org.apache.pig.PigServer.registerQuery(PigServer.java:262)
              at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:446)
              at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:226)
              at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:62)
              at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:60)
              at org.apache.pig.Main.main(Main.java:265)
      Caused by: java.io.IOException: Could not resolve org.apache.pig.test.udf.storefunc.StringStore using imports: [, org.apache.pig.builtin., com.yahoo.pig.yst.sds.ULT., org.apache.pig.impl.builtin.]
              at org.apache.pig.impl.util.WrappedIOException.wrap(WrappedIOException.java:16)
              at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:456)
              at org.apache.pig.impl.PigContext.instantiateFunc(PigContext.java:486)
              ... 15 more
      Caused by: java.lang.ClassNotFoundException: Could not resolve org.apache.pig.test.udf.storefunc.StringStore using imports: [, org.apache.pig.builtin., com.yahoo.pig.yst.sds.ULT., org.apache.pig.impl.builtin.]
              at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:455)
              ... 16 more
      
      2008-04-03 13:20:25,784 [main] ERROR org.apache.pig.tools.grunt.Grunt - could not instantiate 'org.apache.pig.test.udf.storefunc.StringStore' with arguments '[]'
      
      1. testudf.jar
        6 kB
        Xu Zhang
      2. pig_183_v1.patch
        1 kB
        Pi Song

        Activity

          People

          • Assignee:
            Pi Song
            Reporter:
            Xu Zhang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development