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

Santhosh Srinivasan commented on PIG-773:
-----------------------------------------

Review comments:

I am not sure if iterating over the contents of the tuple and adding them to 
the bag is correct.

{code}

-{
- ("(" t = Tuple() {bag.add(t);} ")" ("," "(" t = Tuple() {bag.add(t);} ")" )* )
  {
+//  At this point bag is not empty (i.e., its not{}). So, it must be 
containing one or more tuples.
+// Since Tuple again makes a recursive call it results in all tuples of this 
bag getting  retrieved wrapped
+// in a single tuple. So, we iterate over all the tuples inside the outer 
tuple and then add them in a bag.
+    (
+        t = Tuple() {
+                        for( Object tuple: t.getAll() )
+                            bag.add( (Tuple)tuple );
+                    }
+    ) 
+{
{code}

> Empty complex constants (empty bag, empty tuple and empty map) should be 
> supported
> ----------------------------------------------------------------------------------
>
>                 Key: PIG-773
>                 URL: https://issues.apache.org/jira/browse/PIG-773
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.2.0
>            Reporter: Pradeep Kamath
>            Priority: Minor
>         Attachments: pig-773.patch
>
>
> We should be able to create empty bag constant using {}, empty tuple constant 
> using (), empty map constant using [] within a pig script

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to