You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pig.apache.org by Corbin Hoenes <co...@tynt.com> on 2010/05/28 23:51:36 UTC

using QueryParser?

Found this little gem in the tests:

private Schema parseSchema(String schemaString)
                                            throws ParseException {
        ByteArrayInputStream stream = new ByteArrayInputStream(schemaString.getBytes()) ;
        QueryParser parser = new QueryParser(stream) ;
        return parser.TupleSchema() ;
    }

Was hoping to use this in a udf to pass in a schema like:

com.mystuff.MyUdf('id:int, name:chararray')

When I use QueryParser from my unit tests it works when I it up in a pig script parser.TupleSchema() returns null.  Anyway I can get this to work?