Skip to content

Commit 24d974c

Browse files
dcherednikGazizonoki
authored andcommitted
Moved "Allow Read table call returns not null type" commit from ydb repo
1 parent e7b7a26 commit 24d974c

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

include/ydb-cpp-sdk/client/table/table.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,8 @@ struct TReadTableSettings : public TRequestSettings<TReadTableSettings> {
15751575
FLUENT_SETTING_OPTIONAL(ui64, BatchLimitBytes);
15761576

15771577
FLUENT_SETTING_OPTIONAL(ui64, BatchLimitRows);
1578+
1579+
FLUENT_SETTING_OPTIONAL(bool, ReturnNotNullAsOptional);
15781580
};
15791581

15801582
//! Represents all session operations

src/api/protos/ydb_table.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,6 +1070,7 @@ message ReadTableRequest {
10701070
// greater than any of the limits
10711071
uint64 batch_limit_bytes = 8;
10721072
uint64 batch_limit_rows = 9;
1073+
Ydb.FeatureFlag.Status return_not_null_data_as_optional = 10;
10731074
}
10741075

10751076
// ReadTable doesn't use Operation, returns result directly

src/client/table/impl/table_client.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,13 @@ NThreading::TFuture<std::pair<TPlainStatus, TTableClient::TImpl::TReadTableStrea
786786
request.set_batch_limit_rows(*settings.BatchLimitRows_);
787787
}
788788

789+
if (settings.ReturnNotNullAsOptional_) {
790+
request.set_return_not_null_data_as_optional(
791+
settings.ReturnNotNullAsOptional_.value()
792+
? Ydb::FeatureFlag::ENABLED
793+
: Ydb::FeatureFlag::DISABLED);
794+
}
795+
789796
auto promise = NewPromise<std::pair<TPlainStatus, TReadTableStreamProcessorPtr>>();
790797

791798
Connections_->StartReadStream<Ydb::Table::V1::TableService, Ydb::Table::ReadTableRequest, Ydb::Table::ReadTableResponse>(

0 commit comments

Comments
 (0)