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

Cheng Lian commented on PARQUET-379:
------------------------------------

Just opened one for this: https://github.com/apache/parquet-mr/pull/315

> PrimitiveType.union erases original type
> ----------------------------------------
>
>                 Key: PARQUET-379
>                 URL: https://issues.apache.org/jira/browse/PARQUET-379
>             Project: Parquet
>          Issue Type: Bug
>          Components: parquet-mr
>    Affects Versions: 1.5.0, 1.6.0, 1.7.0, 1.8.0
>            Reporter: Cheng Lian
>
> The following ScalaTest test case
> {code}
>   test("merge primitive types") {
>     val expected =
>       Types.buildMessage()
>         .addField(
>           Types
>             .required(INT32)
>             .as(DECIMAL)
>             .precision(7)
>             .scale(2)
>             .named("f"))
>         .named("root")
>     assert(expected.union(expected) === expected)
>   }
> {code}
> produces the following assertion error
> {noformat}
> message root {
>   required int32 f;
> }
>  did not equal message root {
>   required int32 f (DECIMAL(9,0));
> }
> {noformat}
> This is because {{PrimitiveType.union}} doesn't handle original type 
> properly. An open question is that, can two primitive types with the same 
> primitive type name but different original types be unioned?



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

Reply via email to