Grokbase Groups Pig user May 2013
FAQ
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

Search Discussions

  • ÐΞ€ρ@Ҝ (๏̯͡๏) at May 4, 2013 at 6:24 am
    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, ÐΞ€ρ@Ҝ (๏̯͡๏) 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
  • Jonathan Coveney at May 4, 2013 at 9:52 pm
    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 ÐΞ€ρ@Ҝ (๏̯͡๏) <deepujain@gmail.com>
    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, ÐΞ€ρ@Ҝ (๏̯͡๏) 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
  • ÐΞ€ρ@Ҝ (๏̯͡๏) at May 6, 2013 at 5:26 am
    Thanks Jonathan.
    Figured that out.


    On Sun, May 5, 2013 at 3:21 AM, Jonathan Coveney wrote:

    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 ÐΞ€ρ@Ҝ (๏̯͡๏) <deepujain@gmail.com>
    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, ÐΞ€ρ@Ҝ (๏̯͡๏) <deepujain@gmail.com>
    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


    --
    Deepak

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriespig, hadoop
postedMay 4, '13 at 5:53a
activeMay 6, '13 at 5:26a
posts4
users2
websitepig.apache.org

People

Translate

site design / logo © 2021 Grokbase