[ 
https://issues.apache.org/jira/browse/PIG-4933?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Koji Noguchi updated PIG-4933:
------------------------------
    Attachment: pig-4933-v01.patch

Attaching my initial patch (pig-4933-v01.patch).

bq. The statement doesn't mean to cast to bytearray, it means don't cast. We 
shall remove the bytearray cast. 

Updated POCast to make toByteArray cast as no-op.
(Before, it was returning empty fields.)
Also added testAsWithByteArrayCast to test this condition.

bq. Also if the cast is unnecessary (the original type is the same as the 
cast), we shall remove the cast.

Updated ForEachUserSchemaVisitor to 
* Check if userDefinedSchema do not have type specified in 
{{hasOnlyNullOrByteArraySchema}}.
* Merge expectedschema and userschema so that we don't overwrite field schema 
as bytearray when only alias is provided. {{replaceNullByteArraySchema}}.
* When resetting the schema to null (for the original foreach), made sure to 
reset the type for complicate types (bag/tuple/map). {{resetTypeToNull}}.

And in TestLogicalPlanBuilder.java, uncommented part of the testQuery90 that 
were being skipped for some reasons.

[~daijy], appreciate if you can take a look when you have time.   

> TestDataBagAccess.testBagConstantFlatten1/TestLogicalPlanBuilder.testQuery90  
> broken after PIG-2315
> ---------------------------------------------------------------------------------------------------
>
>                 Key: PIG-4933
>                 URL: https://issues.apache.org/jira/browse/PIG-4933
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Koji Noguchi
>         Attachments: pig-4933-v01.patch
>
>
> {code:title=test.pig}
> A = load '1line.txt';
> B = foreach A generate {(('p1-t1-e1', 'p1-t1-e2'),('p1-t2-e1', 
> 'p1-t2-e2')),(('p2-t1-e1', 'p2-t1-e2'), ('p2-t2-e1', 'p2-t2-e2'))};
> C = foreach B generate $0 as pairbag : { pair: ( t1: (e1, e2), t2: (e1, e2) ) 
> };
> DUMP C;
> {code}
> Above results in empty '()'



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

Reply via email to