[
https://issues.apache.org/jira/browse/PIG-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12925022#action_12925022
]
Alan Gates commented on PIG-1693:
---------------------------------
bq. If we go with "..", then can we mandate that both the beginning and end
indexes are mandatory ? That will avoid the ambiguity in your last example.
As you suggested above, I think we should support 3 cases:
..$x -- $0 through $x, inclusive
$x.. -- $x through end, inclusive
$x..$y -- $x through $y, inclusive
The one change I made from your syntax is keeping the '$' attached to the
positional variables, because this should be legal by alias too. So if one has
a schema (alpha, beta, gamma, delta, epsilon)
..gamma
gamma..
beta..delta
would all be legal too.
> There needs to be a way in foreach to indicate "and all the rest of the
> fields"
> -------------------------------------------------------------------------------
>
> Key: PIG-1693
> URL: https://issues.apache.org/jira/browse/PIG-1693
> Project: Pig
> Issue Type: New Feature
> Components: impl
> Reporter: Alan Gates
> Assignee: Daniel Dai
> Fix For: 0.9.0
>
>
> A common use case we see in Pig is people have many columns in their data and
> they only want to operate on a few of them. Consider for example if before
> storing data with ten columns, the user wants to perform a cast on one column:
> {code}
> ...
> Z = foreach Y generate (int)firstcol, secondcol, thridcol, forthcol,
> fifthcol, sixthcol, seventhcol, eigthcol, ninethcol, tenthcol;
> store Z into 'output';
> {code}
> Obviously this only gets worse as the user has more columns. Ideally the
> above could be transformed to something like:
> {code}
> ...
> Z = foreach Y generate (int)firstcol, "and all the rest";
> store Z into 'output'
> {code}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.