aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwhatsername <whatsername@yandex-team.com>2023-11-28 01:58:22 +0300
committerwhatsername <whatsername@yandex-team.com>2023-11-28 02:23:57 +0300
commit81a61c738d42a24ad014cecaf6d9136b7bbd8e6e (patch)
tree4330b01a5dc0fe57a3c532eeb467300464e9b029
parentc62e64752b2c70d7a81a42c24d38cfa6a0950a78 (diff)
downloadydb-81a61c738d42a24ad014cecaf6d9136b7bbd8e6e.tar.gz
ROREN-48: Support multi table proto read
-rw-r--r--yt/cpp/mapreduce/io/proto_table_reader.cpp13
-rw-r--r--yt/cpp/mapreduce/io/proto_table_reader.h9
2 files changed, 15 insertions, 7 deletions
diff --git a/yt/cpp/mapreduce/io/proto_table_reader.cpp b/yt/cpp/mapreduce/io/proto_table_reader.cpp
index c77c2a220a..555c5345a7 100644
--- a/yt/cpp/mapreduce/io/proto_table_reader.cpp
+++ b/yt/cpp/mapreduce/io/proto_table_reader.cpp
@@ -150,9 +150,6 @@ TProtoTableReader::TProtoTableReader(
, Descriptors_(std::move(descriptors))
{ }
-TProtoTableReader::~TProtoTableReader()
-{ }
-
void TProtoTableReader::ReadRow(Message* row)
{
const auto& node = NodeReader_->GetRow();
@@ -210,15 +207,21 @@ TLenvalProtoTableReader::TLenvalProtoTableReader(
::TIntrusivePtr<TRawTableReader> input,
TVector<const Descriptor*>&& descriptors)
: TLenvalTableReader(std::move(input))
+ , ValidateProtoDescriptor_(true)
, Descriptors_(std::move(descriptors))
{ }
-TLenvalProtoTableReader::~TLenvalProtoTableReader()
+TLenvalProtoTableReader::TLenvalProtoTableReader(
+ ::TIntrusivePtr<TRawTableReader> input)
+ : TLenvalTableReader(std::move(input))
+ , ValidateProtoDescriptor_(false)
{ }
void TLenvalProtoTableReader::ReadRow(Message* row)
{
- ValidateProtoDescriptor(*row, GetTableIndex(), Descriptors_, true);
+ if (ValidateProtoDescriptor_) {
+ ValidateProtoDescriptor(*row, GetTableIndex(), Descriptors_, true);
+ }
while (true) {
try {
diff --git a/yt/cpp/mapreduce/io/proto_table_reader.h b/yt/cpp/mapreduce/io/proto_table_reader.h
index 05a528b9c6..8452545005 100644
--- a/yt/cpp/mapreduce/io/proto_table_reader.h
+++ b/yt/cpp/mapreduce/io/proto_table_reader.h
@@ -18,7 +18,7 @@ public:
explicit TProtoTableReader(
::TIntrusivePtr<TRawTableReader> input,
TVector<const ::google::protobuf::Descriptor*>&& descriptors);
- ~TProtoTableReader() override;
+ ~TProtoTableReader() override = default;
void ReadRow(Message* row) override;
@@ -47,7 +47,11 @@ public:
explicit TLenvalProtoTableReader(
::TIntrusivePtr<TRawTableReader> input,
TVector<const ::google::protobuf::Descriptor*>&& descriptors);
- ~TLenvalProtoTableReader() override;
+
+ explicit TLenvalProtoTableReader(
+ ::TIntrusivePtr<TRawTableReader> input);
+
+ ~TLenvalProtoTableReader() override = default;
void ReadRow(Message* row) override;
@@ -65,6 +69,7 @@ protected:
void SkipRow() override;
private:
+ bool ValidateProtoDescriptor_;
TVector<const ::google::protobuf::Descriptor*> Descriptors_;
};