You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@parquet.apache.org by "David Cardon (JIRA)" <ji...@apache.org> on 2016/05/20 03:28:13 UTC

[jira] [Commented] (PARQUET-388) ProtoRecordConverter might wrongly cast a Message.Builder to Message

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

David Cardon commented on PARQUET-388:
--------------------------------------

A workaround I found was to replace all of the {{Message}} references in [ProtoReadSupport|https://github.com/apache/parquet-mr/blob/master/parquet-protobuf/src/main/java/org/apache/parquet/proto/ProtoReadSupport.java] with {{MessageOrBuilder}}.  You can then fairly easily resolve the {{Builder}} into a {{Message}} outside of the reading mechanism.

> ProtoRecordConverter might wrongly cast a Message.Builder to Message
> --------------------------------------------------------------------
>
>                 Key: PARQUET-388
>                 URL: https://issues.apache.org/jira/browse/PARQUET-388
>             Project: Parquet
>          Issue Type: Bug
>          Components: parquet-mr
>            Reporter: Wu Xiang
>            Assignee: Reuben Kuhnert
>
> ProtoRecordConverter returns current record as follows:
> {code}
>   public T getCurrentRecord() {
>     if (buildBefore) {
>       return (T) this.reusedBuilder.build();
>     } else {
>       return (T) this.reusedBuilder;
>     }
>   }
> {code}
> However this might fail if T is subclass of Message and buildBefore == false, since it's actually casting a Message.Builder instance to Message type.



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