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

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

Review comments:

1. In addition to checking the type of the constant, the value should also be 
checked. The checks on the data type is good. A check on the actual contents of 
the empty bag, empty tuple and empty map will complete the testing.

{code}
+        LOConst loConst = (LOConst)logOp;
+        assertTrue(loConst.getType() == DataType.TUPLE);
+        assertTrue(loConst.getValue() instanceof Tuple);
{code}

2. When you have a bag like {(), (1)}, the schema of this bag is returned as a 
bag that contains a tuple that has no schema. This might be the right approach 
for now, i.e., if a bag contains a tuple with no schema then the schema of the 
bag will contain a tuple with no schema irrespective of the contents of the 
remaining tuple. This approach/idea falls into the bigger question of how to 
handle unknown schemas in Pig. Since Alan is looking at this question for all 
of Pig, it will be good if he can review this part.

> 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.3.0
>            Reporter: Pradeep Kamath
>            Assignee: Ashutosh Chauhan
>            Priority: Minor
>             Fix For: 0.4.0
>
>         Attachments: pig-773.patch, pig-773_v2.patch, pig-773_v3.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