Why do you have an "as" statement with the store? The schema should come down with the script. That's probably the issue.
2013/5/4 ÐΞ€ρ@Ҝ (๏̯͡๏) <[email protected]> > Ignore above query. Its incorrect. > > I have following pig script > A = LOAD 'textinput' using PigStorage() as (a0:chararray, a1:chararray, > a2:chararray, a3:chararray, a4:chararray, a5:chararray, a6:chararray, > a7:chararray, a8:chararray,a9:chararray); > describe A; > store A into 'output2' using PigStorage(); > > This works fine. > > However when i modify the store statement to > store A into 'output3' using PigStorage() as (a0:chararray, a1:chararray, > a2:chararray, a3:chararray, a4:chararray, a5:chararray, a6:chararray, > a7:chararray, a8:chararray,a9:chararray); > > It fails with below error > 2013-05-04 11:49:56,296 [main] ERROR org.apache.pig.tools.grunt.Grunt - > ERROR 1200: <line 9, column 42> mismatched input 'as' expecting SEMI_COLON > > > > On Sat, May 4, 2013 at 11:22 AM, ÐΞ€ρ@Ҝ (๏̯͡๏) <[email protected]> > wrote: > > > PIG 0.11 > > Query : > > I register the below string > > String query = "A = LOAD '" + BENCHMARK_PARQUET_MR_DATA_TEXTINPUT + "' > > using PigStorage() as (" + schemaString + ");"; > > > > with > > pigServer.registerQuery(query); > > > > It translates to > > > > A = LOAD '/home/deepakkv/benchmark/PIG/data/textinput' using > PigStorage() > > as (a0:chararray, a1:chararray, a2:chararray, a3:chararray, a4:chararray, > > a5:chararray, a6:chararray, a7:chararray, a8:chararray, a9:chararray); > > > > > > Exception > > Caused by: Failed to parse: <line 1, column 357> mismatched input 'AS' > > expecting SEMI_COLON > > at > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:235) > > at > > org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:177) > > at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1599) > > > > > > The very same query works in pig grunt shell. > > -- > > Deepak > > > > > > > -- > Deepak >
