Ask Your Question

Revision history [back]

Protobuf Parsing Creates Extra Attributes for OneOf

We're using protobufs and parsing them as they come into StreamSets. Our protobufs use the OneOf type, which means only one of the contained fields is used and has a value. StreamSets appears to be treating the unset fields in the OneOf as optional and giving them all default values. It also doesn't provide anything to indicate which of these attributes is actually set. This makes it difficult or impossible to determine which is actually set - for instance if the set one is given the protobuf default value then it appears the same as the unset attributes. The protobuf api provides 'has_' methods to determine if a field has been set, and I would have expected StreamSets to not set attributes for things that are unset. Is there a way to get this missing information to determine what's actually been set in the protobuf or get it to leave out attributes that shouldn't be set?