You'll need to define the thrift schema and have a set number of fields that are expected in a particular format. You can cheat a little bit by using optional fields, but if the user introduces an unknown field then that approach won't work.
You can also introduce things like a map<string, string> or such to allow you pass it arbitrary data that patterns feels a bit hacky to me. The thing I like the most about thrift is that you define a particular schema which is the 'contract' as to what a user object is, or request obj.. etc. Just my 2 cents. On Wed, Aug 27, 2014 at 9:51 AM, Roger Meier <[email protected]> wrote: > Hi Ed > > Quoting Ed Judge <[email protected]>: > > I am new to Thrift and I am doing a comparison to Avro and want to truly >> understand the difference between static vs dynamic typing. Thrift I >> understand uses static typing while Avro uses dynamic typing. If I want to >> do some filtering of some fields at a “source” and won’t always know the >> schema until a user configures which fields to pull out, will I need to >> regenerate the .thrift file and perform a compilation on it anytime the >> filtering rules change? I am probably not doing a very good job of >> explaining my question. Just wondering if Avro or Thrift are equally >> suitable when the source schema is unknown. >> > > You can use optional fields within your Thrift data structures, > generate the code and use it. > > best! > -roger > > > > >> Thanks, >> -Ed >> > > > -- Thank you Samir Faci
