Hi,

I am registering udf to the pig as given below, using java.

 public static void main(String[] args) {
        try {
            PigServer pigServer = new PigServer("local");
            runIdQuery(pigServer, "/home/chethan/UPPER.jar");
        } catch (Exception e) {
            System.out.println(e);
        }
    }

public static void runIdQuery(PigServer pigServer, String inputFile) throws
IOException {
        pigServer.registerQuery("REGISTER " + inputFile + ";");
        pigServer.registerQuery("raw_data = LOAD
'/home/chethan/sample_data.csv' USING PigStorage( ',' ) AS (listing_id:
chararray,fname: chararray,lname: chararray );");
        pigServer.registerQuery("B = FOREACH raw_data GENERATE
myudfs.UPPER('testlog');");
}

ERROR:

org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error
during parsing. <line 1, column 9>  Syntax error, unexpected symbol at or
near '/'

Reply via email to