thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rennalls <>
Subject Re: union support
Date Wed, 25 Sep 2013 17:26:41 GMT
On Sat, Sep 21, 2013 at 9:45 AM, Jens Geyer <> wrote:
> Hi David,
> I agree, and want to thank you for all the recherche work below.

No problem, I figured I'd share what my digging turned to save others
the trouble.

>> 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
> idea.

I agree better docs are needed, but I think adding it to the tutorial
is a good idea. I usually find that working code samples (incl unit
tests) are more valuable than docs.

>>  It's not mentioned in the IDL docs (,
> Now it is.

Thanks for the taking the time !

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


> Best regards,
> JensG
> -----Urspr√ľngliche Nachricht----- From: David Rennalls
> Sent: Friday, September 20, 2013 4:43 PM
> To:
> Subject: union support
> Hi,
>   I only recently discovered Thrift's support for unions. It's not
> mentioned in the IDL docs (, the
> tutorial .thrift file
> (;a=blob_plain;f=tutorial/tutorial.thrift)
> 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..
> Thanks,
>   David

View raw message