snowplow / snowplow-scala-analytics-sdk

Scala SDK for working with Snowplow enriched events in Spark, AWS Lambda, Flink et al.
https://snowplow.github.io/snowplow-scala-analytics-sdk/
20 stars 14 forks source link

Parse Event from a ByteBuffer #130

Closed istreeter closed 11 months ago

istreeter commented 12 months ago

This is part of my drive to reduce how many times we are copying data in memory.

Snowplow apps downstream of Enrich need to parse a TSV line to get an Event. The TSV line enters the app as an array of bytes (or a byte buffer). Until now, we always convert the bytes into a string, and then afterwards parse the string into an Event. But it should be possible to do it in a single step from a byte buffer.