thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jens Geyer" <>
Subject Re: union support
Date Sat, 21 Sep 2013 13:45:34 GMT
Hi David,

I agree, and want to thank you for all the recherche work below.

> How come it's not documented anywhere ? It seems like a pretty
> major thing to be omitted.

As you found out, most of the documentation is in the (somewhat outdated) 
Wiki and the Jira tickets. Some more information can be found in the mailing 
archives, however that is a time-consuming and sometimes frustrating task. 
So yes, I agree that the documentation absolutely needs improvement. should also be mentioned in 
that context. In general, unions have been introduced since 2009, there has 
been some improvement in the last months, contained in the 0.9.1 release.

> is up to date?

No, terribly outdated. Some languages are not even listed there.

>  It's not mentioned in [...] the tutorial.thrift file

True. But it is mentioned in ThriftSpec.thrift and DebugProtoTest.thrift, 
altough both files are not on a prominent place in the source tree. 
Integrating it into the tutorials would only make sense, if all tutorial 
implementations get updated accordingly. I'm not so sure if that is a good 

>  It's not mentioned in the IDL docs (,

Now it is.

And  of course, any patches are highly appreciated. ;-)

Best regards,

-----Urspr√ľngliche Nachricht----- 
From: David Rennalls
Sent: Friday, September 20, 2013 4:43 PM
Subject: union support

   I only recently discovered Thrift's support for unions. It's not
mentioned in the IDL docs (, the
tutorial .thrift file
nor the "missing guide"
( I only stumbled
onto it from this blog post
Looks like Java support was added in 0.2 (with and Ruby support was
added in 0.3 (with
How come it's not documented anywhere ? It seems like a pretty major
thing to be omitted.

Someone had the same question on the mailing list a while back where they
referenced these blog posts (had to use web archive versions)..
...the rapleaf blog author was originally using the "workaround" of
having a struct with all optional fields and then ended up raising a
JIRA to get union support added etc... We're using that "workaround"
where I work right now, but looks like it would be good to transition
to unions as that was the desired behavior in the first place.

According to
(April 2011)...
"...There is full-fledged support for Unions in the IDL and the Java
and Ruby libraries. Other languages will just generate a struct with
the same set of fields, so they are backwards compatible...."

I also found this for C# support, but is that in 0.9
or just trunk ? I saw some JIRAs mentioning C++ and unions as well. Is
the 'Unions' column on
up-to-date ? We have a Java server with clients in Java, Perl and
Python and we're using 0.9.0, so I guess transitioning to using unions
would only benefit Java code (and IDL readability) in our case. While
typing this I noticed there's already a JIRA for updating the docs, so I won't raise
another one. However, until more detailed docs can be added (I know it
takes time) could someone at least add it to the IDL page so new users
know about it. If users are at least made aware of it they can do more
digging on it's usage, supported languages etc..


View raw message