From 92045d5f545e8db35037104aa6089bd1f7622bb0 Mon Sep 17 00:00:00 2001 From: Jimmy Lu Date: Wed, 17 Apr 2024 13:11:48 -0700 Subject: [PATCH] Add KLL serialization format compatiblity guarantee (#9518) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/9518 Differential Revision: D56264716 --- velox/functions/lib/KllSketch.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/velox/functions/lib/KllSketch.h b/velox/functions/lib/KllSketch.h index ca8bc79c2be1..eab6ffb1e28f 100644 --- a/velox/functions/lib/KllSketch.h +++ b/velox/functions/lib/KllSketch.h @@ -105,11 +105,14 @@ struct KllSketch { /// Calculate the size needed for serialization. size_t serializedByteSize() const; - /// Serialize the sketch into bytes. + /// Serialize the sketch into bytes. The serialzation is versioned, and newer + /// version of code should be able to read all previous versions. + /// /// @param out Pre-allocated memory at least serializedByteSize() in size void serialize(char* out) const; - /// Deserialize a sketch from bytes. + /// Deserialize a sketch from bytes. Newer version of code should be able to + /// read all previous versions. static KllSketch deserialize( const char* data, const Allocator& = Allocator(),