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

Rohini Palaniswamy commented on PIG-4674:
-----------------------------------------

{code}
+        byte valueType = DataType.BYTEARRAY;
.....
+                    if (valueType == DataType.BYTEARRAY || valueType == 
input.getFields().get(i).type) {
+                        valueType = input.getFields().get(i).type;
+                    } else {
+                        valueType = DataType.BYTEARRAY;
+                        break;
+                    }
{code}

should be

{code}
+        Byte valueType = null;
+                    if (valueType == null)) {
+                        valueType = input.getFields().get(i).type;
+                    } else if (valueType != input.getFields().get(i).type) {
+                        valueType = DataType.BYTEARRAY;
+                        break;
+                    }
{code}

Without that if we had a0,a1,a2,a3 with a1 as bytearray and a3 as int, it will 
become map[int] instead of map[bytearray]. 

> TOMAP should infer schema
> -------------------------
>
>                 Key: PIG-4674
>                 URL: https://issues.apache.org/jira/browse/PIG-4674
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>             Fix For: 0.16.0
>
>         Attachments: PIG-4674-1.patch, PIG-4674-2.patch
>
>
> TOMAP schema is map only without map value schema. This should be inferred if 
> available.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to