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

Wes McKinney commented on ARROW-4213:
-------------------------------------

I would be OK with sending the schema always in DoGet.

On the IPC message, I think we are saying different things. We have the 
Flatbuffers {{Message}} type which has the metadata version and can represent 
different kinds of IPC messages

https://github.com/apache/arrow/blob/master/format/Message.fbs#L93

In 
https://github.com/apache/arrow/blob/87feee3d941ee41fb39b25411e108bef40a55995/java/vector/src/main/java/org/apache/arrow/vector/types/pojo/Schema.java#L168,
 the schema is being serialized as the Schema type. I'm just saying to put the 
Schema inside a Message. It has the side benefit of including the metadata 
version so the reader can check for protocol version compatibility. 

In C++, the Schema is serialized here

* 
https://github.com/apache/arrow/blob/master/cpp/src/arrow/flight/internal.cc#L205

This calls {{WriteSchemaMessage}} 
https://github.com/apache/arrow/blob/e0f70bbf9bc8eb909373abaaf0b4c9f50bc0a2d6/cpp/src/arrow/ipc/writer.cc#L784
 which puts the Schema inside the Message union

https://github.com/apache/arrow/blob/ce9c6e3914274dcaf7806159ea5373e0cb632727/cpp/src/arrow/ipc/metadata-internal.cc#L690

> [Flight] C++ and Java implementations are incompatible
> ------------------------------------------------------
>
>                 Key: ARROW-4213
>                 URL: https://issues.apache.org/jira/browse/ARROW-4213
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: FlightRPC
>            Reporter: David Li
>            Priority: Major
>              Labels: flight
>             Fix For: 0.13.0
>
>
> A C++ client cannot request streams from a Java service, nor can it decode 
> the schema from GetFlightInfo.
> Schema: in Java, GetFlightInfo encodes the schema directly via flatbuffers. 
> C++ expects it to be encoded as an IPC message. This isn't a problem in Java 
> as a method exists to decode such schemas, but in C++ the API for reading 
> such a schema isn't really exposed. I'm willing to submit a patch for this, 
> but it's not clear to me which scheme is preferred.
> Streams: in Java, DoGet starts with an ArrowMessage containing a schema. C++ 
> does not expect this and segfaults when it tries to decode the message as a 
> record batch. Based on the presentations I've seen, I think C++ is in the 
> wrong here; I have a patch to fix this that I could clean up and submit.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to