You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Rohini Palaniswamy (JIRA)" <ji...@apache.org> on 2017/03/28 20:48:41 UTC

[jira] [Comment Edited] (PIG-5201) Null handling on FLATTEN

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

Rohini Palaniswamy edited comment on PIG-5201 at 3/28/17 8:48 PM:
------------------------------------------------------------------

In my opinion, FLATTEN(null) or FLATTEN(bagwithnull) should produce nulls based on the number of elements in the schema of the field instead of a single null.

For eg:
  - FLATTEN(null) where the field is a tuple with 3 inner fields, it should produce three nulls
  - FLATTEN(bagwithnull) where the bag contains 3 inner fields, it should produce three nulls. Same as above.
 - FLATTEN(null) where the column is a map, it should produce two nulls (one each for key and value)

It is tricky when the tuple or bag does not have schema. In that case we can probably retain the current behavior of producing single null and document it.



was (Author: rohini):
In my opinion, FLATTEN(tuple with two columns in schema) should produce two nulls instead of the single null it is producing now.

> Null handling on FLATTEN
> ------------------------
>
>                 Key: PIG-5201
>                 URL: https://issues.apache.org/jira/browse/PIG-5201
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>            Priority: Minor
>         Attachments: pig-5201-v00-testonly.patch
>
>
> Sometimes, FLATTEN(null) or FLATTEN(bag-with-null) seem to produce incorrect results.
> Test code/script to follow.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)