[ 
https://issues.apache.org/jira/browse/PIG-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13079660#comment-13079660
 ] 

Dmitriy V. Ryaboy commented on PIG-2205:
----------------------------------------

It used to be that something like the script below was thrown out by the parser:
{code}
filtered = filter my_relation by my_relation.x > 2;
{code}
We now try to actually evaluate that, treating my_relation as a scalar to be 
loaded up while iterating over my_relation. 
We should instead suggest that the user probably wanted to write 
{code}
filtered = filter my_relation by x > 2;
{code}

A similar problems occurs in this code:

{code}
joined = join a by id, b by id;
projected = foreach joined generate a.id;
{code}

Naturally, the user actually meant

{code}
projected = foreach joined generate a::id;
{code}

Instead of erroring out, we currently generate massive plans that involve lots 
of splits (I saw a 5-line script filled with this syntax mistake generate 12 
jobs!), and fail eventually with "Scalar has more than one row in the output" 
-- which doesn't help a user who is not advanced enough to know about Scalars.

This is extra confusing to people coming from a SQL background, who are of 
course extremely used to referring to their tables' fields this way.

> Improve error checking around Scalar functionality
> --------------------------------------------------
>
>                 Key: PIG-2205
>                 URL: https://issues.apache.org/jira/browse/PIG-2205
>             Project: Pig
>          Issue Type: Improvement
>            Reporter: Dmitriy V. Ryaboy
>
> The scalar-loading feature added in 0.8 has caused a new class of user 
> problems to show up, when they use the "foo.bar" syntax incorrectly.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to