I've seen quite a few times where people have stored these types of
structured objects in Parquet.
Initially Parquet only supported to fully decompose them into columns
(avro, thrift and protobufs were implemented early on). this usually comes
from instrumentation of services that either use these to encode their rpc
and can easily send them as events or need a schema to enforce
compatibility over time. They then get written into parquet files (for
example reading from kafka).
Sometimes we end up storing the original value as a binary column. There
could be several reasons. When they are a bit big, it might not be
efficient to fully decompose them into columns. I have personally seen the
case of not knowing what to do with unknown value coming from thrift. The
reader schema might not be the same version as the writer as protos and
thrift allow. Since these are well known formats with clear schemas it is
convenient to be able to store the schema for those binary object so it is
explicit rather than forcing converting to a different format that may not
be 1-1 or just leaving it as binary.
It seems a bit niche but I think it is useful to people who need it while
not inconvenient to people who don't.

On Fri, Nov 13, 2026 at 3:16 PM Scott Haines <[email protected]>
wrote:

> This use case reminds me of what we ended up doing at Twilio to offload our
> protobuf records for Voice Insights from Kafka to Parquet on HDFS for
> historic replay.
>
> We essentially ended up serializing the raw DataFrame from Apache Spark's
> Kafka connector (this was early days of Structured Streaming - around Spark
> 2.3 days) and kept the original Kafka payload bytes for our CallSummarizer
> (produced call detail records (CDRs)).
>
> We used the struct<timestamp:uint64,key:byte[], payload:byte[],
> topic:string, version:uint32, format:string[protobuf], serde:string> the
> serde was for a Java class and we had a custom ExpressionEncoder since
> protobuf wasn't a first class citizen in Spark at the time. There was a
> good amount of overhead to store the serde=`com.twilio.voice.insights.Call`
> fields across millions of events a minute - and I'd see the same overhead
> if you pack the protobuf's FileDescriptorSet or a reference to where that
> lives in a registry (buf schema registry, confluent schema registry, etc)
>
> With all of this said, having support to efficiently store the protobuf (or
> serde) metadata would have helped us lay out these historic records better.
>
> --
> *Scott Haines*
> OSS Engineer
> E: 408.768.3799 <(408)%20768-3799>
> LI: https://www.linkedin.com/in/scotthaines/
>

Reply via email to