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

Lukas Nalezenec commented on PARQUET-388:
-----------------------------------------

> To be sure, when you say 'The cast is correct', do you mean by that 
> ProtoRecordConverter<MyProtoMessage>::getCurrentRecord would work correctly ?

No, it won't work correctly but  
ProtoRecordConverter<MyProtoMessage.Builder>::getCurrentRecord will work 
correctly.

> The signature for ProtoReadSupport is as follows, which leads 
> ProtoReadSupport<MyProtoMessage.Builder> to compile time error.

It looks like there is bug in the signature. IMO it should be 

public class ProtoReadSupport<T extends MessageOrBuilder > extends 
ReadSupport<T> {}

I will look at it later today.

Thank you very much.

> 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)

Reply via email to