[
https://issues.apache.org/jira/browse/PIG-3434?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Pavel Fedyakov updated PIG-3434:
--------------------------------
Description:
According to docs, for bincond operator "If a Boolean subexpression results in
null value, the resulting expression is null"
(http://pig.apache.org/docs/r0.11.0/basic.html#nulls).
It works as described in plain foreach..generate expression:
{{in = load 'in';}}
{{out = FOREACH in GENERATE 1, ($0 > 0 ? 2 : 3);}}
{{dump out;}}
in (3 lines, 2nd is empty):
{{0}}
{{1}}
out:
{{(1,3)}}
{{(1,)}}
{{(1,2)}}
But if we wrap generated variables in tuple (or bag), we lose the whole 2nd
line in output:
{{out = FOREACH in GENERATE (1, ($0 > 0 ? 2 : 3));}}
out:
{{((1,3))}}
{{()}}
{{((1,2))}}
was:
According to docs, for bincond operator "If a Boolean subexpression results in
null value, the resulting expression is null"
(http://pig.apache.org/docs/r0.11.0/basic.html#nulls).
It works as described in plain foreach..generate expression:
{{in = load 'in';}}
{{out = FOREACH in GENERATE 1, ($0 > 0 ? 2 : 3);}}
{{dump out;}}
in (3 lines, 2nd is empty):
{{0}}
{{1}}
out:
{{(1,3)}}
{{(1,)}}
{{(1,2)}}
But if we wrap generated variables in tuple (or bag), we lost the whole 2nd
line in output:
{{out = FOREACH in GENERATE (1, ($0 > 0 ? 2 : 3));}}
out:
{{((1,3))}}
{{()}}
{{((1,2))}}
> Null subexpression in bincond nullifies outer tuple (or bag)
> ------------------------------------------------------------
>
> Key: PIG-3434
> URL: https://issues.apache.org/jira/browse/PIG-3434
> Project: Pig
> Issue Type: Bug
> Reporter: Pavel Fedyakov
>
> According to docs, for bincond operator "If a Boolean subexpression results
> in null value, the resulting expression is null"
> (http://pig.apache.org/docs/r0.11.0/basic.html#nulls).
> It works as described in plain foreach..generate expression:
> {{in = load 'in';}}
> {{out = FOREACH in GENERATE 1, ($0 > 0 ? 2 : 3);}}
> {{dump out;}}
> in (3 lines, 2nd is empty):
> {{0}}
> {{1}}
> out:
> {{(1,3)}}
> {{(1,)}}
> {{(1,2)}}
> But if we wrap generated variables in tuple (or bag), we lose the whole 2nd
> line in output:
> {{out = FOREACH in GENERATE (1, ($0 > 0 ? 2 : 3));}}
> out:
> {{((1,3))}}
> {{()}}
> {{((1,2))}}
--
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