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

Wu Xiang updated PARQUET-388:
-----------------------------
    Description: 
ProtoRecordConverter returns current record as follows:

  public T getCurrentRecord() {
    if (buildBefore) {
      return (T) this.reusedBuilder.build();
    } else {
      return (T) this.reusedBuilder;
    }
  }

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.

  was:
ProtoRecordConverter returns current record as follows:

  public T getCurrentRecord() {
    if (buildBefore) {
      return (T) this.reusedBuilder.build();
    } else {
      return (T) this.reusedBuilder;
    }
  }

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.


> 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
>
> ProtoRecordConverter returns current record as follows:
>   public T getCurrentRecord() {
>     if (buildBefore) {
>       return (T) this.reusedBuilder.build();
>     } else {
>       return (T) this.reusedBuilder;
>     }
>   }
> 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)

Reply via email to