Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 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?
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB