FAQ
I'm writing my own LoadFunc which take parameters. I'm finding the only
valid parameter type is String. I can't seem to pass an int. Are the
parameter types for LoadFunc restricted to strings? I'm using Pig 3.0.

Here is my function signature

public CSVLoadFunc( int test1 ) {

System.out.println( "Testing a csv load func with one argument which is a
num: " + test1 );

}


Here is my load line

load 'a' using test.CSVLoadFunc(1) as (header1: chararray, header2:
chararray, header3: chararray, header4: chararray, header5: chararray,
header6: chararray);


This is the error I'm getting


Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException:
Encountered " <INTEGER> "1 "" at line 1, column 85.

Was expecting one of:

<QUOTEDSTRING> ...

")" ...



at
org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(
QueryParser.java:8602)


Am I doing something wrong or are only Strings supported.


Thanks

Bob

Search Discussions

  • Pradeep Kamath at Feb 20, 2010 at 12:33 am
    Only Strings are supported.

    -Pradeep

    -----Original Message-----
    From: Robert Goodman
    Sent: Friday, February 19, 2010 3:58 PM
    To: pig-user@hadoop.apache.org
    Subject: LoadFunc parameters only Strings

    I'm writing my own LoadFunc which take parameters. I'm finding the only
    valid parameter type is String. I can't seem to pass an int. Are the
    parameter types for LoadFunc restricted to strings? I'm using Pig 3.0.

    Here is my function signature

    public CSVLoadFunc( int test1 ) {

    System.out.println( "Testing a csv load func with one argument which is
    a
    num: " + test1 );

    }


    Here is my load line

    load 'a' using test.CSVLoadFunc(1) as (header1: chararray, header2:
    chararray, header3: chararray, header4: chararray, header5: chararray,
    header6: chararray);


    This is the error I'm getting


    Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException:
    Encountered " <INTEGER> "1 "" at line 1, column 85.

    Was expecting one of:

    <QUOTEDSTRING> ...

    ")" ...



    at
    org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseExcepti
    on(
    QueryParser.java:8602)


    Am I doing something wrong or are only Strings supported.


    Thanks

    Bob

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedFeb 19, '10 at 11:58p
activeFeb 20, '10 at 12:33a
posts2
users2
websitepig.apache.org

2 users in discussion

Robert Goodman: 1 post Pradeep Kamath: 1 post

People

Translate

site design / logo © 2021 Grokbase