diff options
author | atarasov5 <[email protected]> | 2025-07-23 11:24:03 +0300 |
---|---|---|
committer | atarasov5 <[email protected]> | 2025-07-23 12:25:55 +0300 |
commit | f531c2bc5154672d6ba28f691d3a4bdf7ff90c34 (patch) | |
tree | ef0b71a8dd91f7719b54c95d5a01b3e4d729106a /yql/essentials/minikql/computation/mkql_computation_node_pack.h | |
parent | 9d67ed79ecd1a554c6606e8ae27ca146bd828b05 (diff) |
YQL-19995: Fix block serialization for child data with different offsets
В данном пулреквесте я добавил поддержку сериализации tuple/struct массивов с разными оффсетами.
Сделал это через новый флаг `EValuePackerVersion::{V0, V1}`.
Также нужно будет сделать коммит в contrib/ydb
commit_hash:79709ad660a4295958e5488d3dd24d660f32ca9a
Diffstat (limited to 'yql/essentials/minikql/computation/mkql_computation_node_pack.h')
-rw-r--r-- | yql/essentials/minikql/computation/mkql_computation_node_pack.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/yql/essentials/minikql/computation/mkql_computation_node_pack.h b/yql/essentials/minikql/computation/mkql_computation_node_pack.h index 12aac705bb9..6c200631bf2 100644 --- a/yql/essentials/minikql/computation/mkql_computation_node_pack.h +++ b/yql/essentials/minikql/computation/mkql_computation_node_pack.h @@ -70,17 +70,33 @@ private: mutable NDetails::TPackerState State_; }; +// This version specify exactly how data will be packed and unpacked. +enum class EValuePackerVersion { + V0 = 0, // Initial version. + V1 = 1, // Fixed Block type |child_data| serialization/deserialization. + // Remove the invariant of equality of offsets for all recursive children. +}; + template<bool Fast> class TValuePackerTransport { public: using TSelf = TValuePackerTransport<Fast>; + explicit TValuePackerTransport(const TType* type, EValuePackerVersion valuePackerVersion, + TMaybe<size_t> bufferPageAllocSize = Nothing(), arrow::MemoryPool* pool = nullptr, TMaybe<ui8> minFillPercentage = Nothing()); + + // Deprecated: For YDB sync only. explicit TValuePackerTransport(const TType* type, - TMaybe<size_t> bufferPageAllocSize = Nothing(), arrow::MemoryPool* pool = nullptr, TMaybe<ui8> minFillPercentage = Nothing()); + TMaybe<size_t> bufferPageAllocSize = Nothing(), arrow::MemoryPool* pool = nullptr, TMaybe<ui8> minFillPercentage = Nothing()); + // for compatibility with TValuePackerGeneric - stable packing is not supported - TValuePackerTransport(bool stable, const TType* type, + TValuePackerTransport(bool stable, const TType* type, EValuePackerVersion valuePackerVersion, TMaybe<size_t> bufferPageAllocSize = Nothing(), arrow::MemoryPool* ppol = nullptr, TMaybe<ui8> minFillPercentage = Nothing()); + // Deprecated: For YDB sync only. + TValuePackerTransport(bool stable, const TType* type, + TMaybe<size_t> bufferPageAllocSize = Nothing(), arrow::MemoryPool* ppol = nullptr, TMaybe<ui8> minFillPercentage = Nothing()); + // AddItem()/UnpackBatch() will perform incremental packing - type T is processed as list item type. Will produce List<T> layout TSelf& AddItem(const NUdf::TUnboxedValuePod& value); TSelf& AddWideItem(const NUdf::TUnboxedValuePod* values, ui32 count); @@ -125,7 +141,7 @@ private: bool IsBlock_ = false; bool IsLegacyBlock_ = false; ui32 BlockLenIndex_ = 0; - + EValuePackerVersion ValuePackerVersion_; TVector<std::unique_ptr<IBlockSerializer>> BlockSerializers_; TVector<std::unique_ptr<IBlockReader>> BlockReaders_; TVector<std::shared_ptr<arrow::ArrayData>> ConvertedScalars_; |