diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-06-13 01:43:31 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-06-13 01:54:13 +0300 |
commit | f95df48ba1824e3a51c19c15499eaa71905260aa (patch) | |
tree | 3f00d2aa04dd81aaee5f086dafe29c230eac91a9 | |
parent | 3069c8835032617846ef6fc3a911daf67b9d3f72 (diff) | |
download | ydb-f95df48ba1824e3a51c19c15499eaa71905260aa.tar.gz |
Intermediate changes
-rw-r--r-- | yt/yt/client/table_client/unittests/helpers/helpers.cpp | 40 | ||||
-rw-r--r-- | yt/yt/client/table_client/unittests/helpers/helpers.h | 4 |
2 files changed, 44 insertions, 0 deletions
diff --git a/yt/yt/client/table_client/unittests/helpers/helpers.cpp b/yt/yt/client/table_client/unittests/helpers/helpers.cpp index 6f9754aa28..d59dcd9a58 100644 --- a/yt/yt/client/table_client/unittests/helpers/helpers.cpp +++ b/yt/yt/client/table_client/unittests/helpers/helpers.cpp @@ -277,6 +277,46 @@ void PrintTo(const TColumnarStatistics& statistics, std::ostream* os) << ::testing::PrintToString(statistics.LegacyChunkRowCount); } +NTableChunkFormat::NProto::TSegmentMeta CreateSimpleSegmentMeta() +{ + NTableChunkFormat::NProto::TSegmentMeta segmentMeta; + segmentMeta.set_version(1); + segmentMeta.set_type(2); + segmentMeta.set_row_count(3); + segmentMeta.set_block_index(4); + segmentMeta.set_offset(5); + segmentMeta.set_chunk_row_count(6); + segmentMeta.set_size(7); + + { + auto* meta = segmentMeta.MutableExtension(NTableChunkFormat::NProto::TTimestampSegmentMeta::timestamp_segment_meta); + meta->set_min_timestamp(0); + meta->set_expected_writes_per_row(0); + meta->set_expected_deletes_per_row(0); + } + + { + auto* meta = segmentMeta.MutableExtension(NTableChunkFormat::NProto::TIntegerSegmentMeta::integer_segment_meta); + meta->set_min_value(0); + } + + { + auto* meta = segmentMeta.MutableExtension(NTableChunkFormat::NProto::TStringSegmentMeta::string_segment_meta); + meta->set_expected_length(0); + } + + { + auto* meta = segmentMeta.MutableExtension(NTableChunkFormat::NProto::TDenseVersionedSegmentMeta::dense_versioned_segment_meta); + meta->set_expected_values_per_row(0); + } + + { + auto* meta = segmentMeta.MutableExtension(NTableChunkFormat::NProto::TSchemalessSegmentMeta::schemaless_segment_meta); + meta->set_expected_bytes_per_row(0); + } + return segmentMeta; +} + //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NTableClient diff --git a/yt/yt/client/table_client/unittests/helpers/helpers.h b/yt/yt/client/table_client/unittests/helpers/helpers.h index 2aa50d5b46..ef17b4cae3 100644 --- a/yt/yt/client/table_client/unittests/helpers/helpers.h +++ b/yt/yt/client/table_client/unittests/helpers/helpers.h @@ -8,6 +8,8 @@ #include <yt/yt/client/table_client/public.h> #include <yt/yt/client/table_client/row_batch.h> +#include <yt_proto/yt/client/table_chunk_format/proto/column_meta.pb.h> + #include <iostream> namespace NYT::NTableClient { @@ -226,6 +228,8 @@ std::vector<TUnversionedRow> CreateFilteredRangedRows( void PrintTo(const TColumnarStatistics& statistics, std::ostream* os); +NTableChunkFormat::NProto::TSegmentMeta CreateSimpleSegmentMeta(); + //////////////////////////////////////////////////////////////////////////////// } // namespace NYT::NTableClient |