[ 
https://issues.apache.org/jira/browse/PIG-3414?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Cheolsoo Park updated PIG-3414:
-------------------------------

    Status: Open  (was: Patch Available)

[~xuefuz], thank you for your comment sir!

I agree with you. In fact, this issue doesn't exist when the schema definition 
is used inside the AS clause in a LOAD statement because the grammar looks for 
a right parenthesis and throws a parser exception if it doesn't find one. 
Unfortunately, I didn't have a good idea to detect this in the grammar itself 
when the schema definition is used alone.

For the context, I have a load func that takes the schema string as an option, 
and I use this helper function to parse it. One user accidentally omitted a 
comma, and that resulted in some surprising side-effects in downstream ETL 
processes. So I put some quick fix to prevent such unfortunate event again.

But yes, I agree that this is probably not the best approach. I will cancel the 
patch for now. :-)
                
> QueryParserDriver.parseSchema(String) silently returns a wrong result when a 
> comma is missing in the schema definition
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: PIG-3414
>                 URL: https://issues.apache.org/jira/browse/PIG-3414
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>            Reporter: Cheolsoo Park
>            Assignee: Cheolsoo Park
>             Fix For: 0.12
>
>         Attachments: PIG-3414.patch
>
>
> QueryParserDriver provides a convenient method to parse from string to 
> LogicalSchema. But if a comma is missing between two fields in the schema 
> definition, it silently returns a wrong result. For example,
> {code}
> a:int b:long
> {code}
> This string will be parsed up to "a:int", and "b:long" will be silently 
> discarded. This should rather fail with a parser exception.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to