avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Zoller <gzol...@gmail.com>
Subject Deep polymorphic type support
Date Fri, 08 Sep 2017 18:35:42 GMT
Hello,

I'm trying to learn if Avro currently supports deep polymorphic types like
outlined here:
https://stackoverflow.com/questions/46120578/how-might-i-represent-a-scala-trait-in-avro

If not, could the standard be extended?

The use case is this... I want to send an AlarmMessage, serialized as a
Message[PayloadKind].  The receiving side would have enough type data to
reconstruct the AlarmMessage (Alarm is of type Event, which is of type
PayloadKind).  In other words I'd "listen" for Message[PayloadKind] and be
handed an AlarmMessage.

Of course we'd need to have schema entries for any kind of Event (or
PayloadKind child for that matter), but there'd also need to be a way to
represent these intermediate marker traits.

Thoughts?
Greg

(A trivial json example of what I mean can be found here:
https://github.com/gzoller/ScalaJack/blob/master/doc/classesAndTraits.md )

Mime
View raw message