Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> using QueryParser?


Copy link to this message
-
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?