[
https://issues.apache.org/jira/browse/PIG-1693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12924114#action_12924114
]
Milind Bhandarkar commented on PIG-1693:
----------------------------------------
Talked to Olga and Thejas offline. Told them my reservations about "...".
Ranges are a well-established concepts in scripting languages.
For example, Perl array slicing uses "..", Python uses ":".
... is used for varargs, which means any number of arguments, and does not
define a range.
So, ".." (notice, two dots, not three) can be considered.
Basically, a range is specified by a beginning and an end.
If beginning is omitted, then 0 is assumed.
If end is omitted, then max_index(range) is assumed.
If we use ':', then omitting beginning or end does not look odd as ".."
To give you an example, if I want to specify all fields after 3, there are two
choices.
$4.., or $4:
If I want to specify all the fields upto field 6,
$..6, ot $:6
If I want to specify fields between 3 and 10,
$3..10 or $3:10.
Please choose between .. and :.
> 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.