[ 
https://issues.apache.org/jira/browse/THRIFT-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12689703#action_12689703
 ] 

David Reiss commented on THRIFT-409:
------------------------------------

bq. I thought of this as an option, but I think that will lead to suboptimal 
wire performance.

It's one byte.  Using a different wire format makes it impossible to implement 
this incrementally.  *Every* language must be able to skip unions before you 
can start writing them.  Plus it makes it impossible to transparently upgrade 
from current "all-optional" structures.

bq. I'll admit I'm not sure on how the container thing might work, but I don't 
think it will make the struct code that much more complicated.

I think it is important to figure the containers out, and I disagree about the 
struct case.  If you have a state that represents a union whose content could 
not be read, then the code for reading a union looks *exactly* the same as the 
code for reading a structure, when viewed from the perspective of the caller.

> Add "union" to Thrift
> ---------------------
>
>                 Key: THRIFT-409
>                 URL: https://issues.apache.org/jira/browse/THRIFT-409
>             Project: Thrift
>          Issue Type: New Feature
>            Reporter: Bryan Duxbury
>             Fix For: 0.2
>
>
> It would be very helpful to have a "union" construct in Thrift. Let's decide 
> on the design and then break up into sub-issues to add this feature.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to