From 58703dd29156f601d0f4781b6a68725a216c5906 Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Mon, 9 Dec 2024 12:21:40 +0300 Subject: [PATCH 1/4] scan policy sql control --- .../tablestore/operations/upsert_opt.cpp | 11 +++++--- .../tablestore/operations/upsert_opt.h | 2 +- ydb/core/kqp/ut/olap/aggregations_ut.cpp | 27 +++++++++++++++++++ ydb/core/protos/flat_scheme_op.proto | 2 +- .../engines/reader/abstract/read_metadata.h | 4 +-- .../engines/reader/transaction/tx_scan.cpp | 11 +++++++- .../columnshard/engines/scheme/index_info.cpp | 4 ++- .../columnshard/engines/scheme/index_info.h | 6 ++--- .../tx/schemeshard/olap/options/schema.cpp | 12 ++++----- ydb/core/tx/schemeshard/olap/options/schema.h | 2 +- ydb/core/tx/schemeshard/olap/options/update.h | 10 +++---- 11 files changed, 67 insertions(+), 24 deletions(-) diff --git a/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp b/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp index b60cf24845f8..651028307434 100644 --- a/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp +++ b/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp @@ -10,7 +10,12 @@ TConclusionStatus TUpsertOptionsOperation::DoDeserialize(NYql::TObjectSettingsIm return TConclusionStatus::Fail("Incorrect value for SCHEME_NEED_ACTUALIZATION: cannot parse as boolean"); } SchemeNeedActualization = *value; - ExternalGuaranteeExclusivePK = features.Extract("EXTERNAL_GUARANTEE_EXCLUSIVE_PK"); + ScanReaderPolicyName = features.Extract("SCAN_READER_POLICY_NAME"); + if (ScanReaderPolicyName) { + if (*ScanReaderPolicyName != "PLAIN" && *ScanReaderPolicyName != "SIMPLE") { + return TConclusionStatus::Fail("SCAN_READER_POLICY_NAME have to be in ['PLAIN', 'SIMPLE']"); + } + } if (const auto className = features.Extract("COMPACTION_PLANNER.CLASS_NAME")) { if (!CompactionPlannerConstructor.Initialize(*className)) { return TConclusionStatus::Fail("incorrect class name for compaction planner:" + *className); @@ -52,8 +57,8 @@ TConclusionStatus TUpsertOptionsOperation::DoDeserialize(NYql::TObjectSettingsIm void TUpsertOptionsOperation::DoSerializeScheme(NKikimrSchemeOp::TAlterColumnTableSchema& schemaData) const { schemaData.MutableOptions()->SetSchemeNeedActualization(SchemeNeedActualization); - if (ExternalGuaranteeExclusivePK) { - schemaData.MutableOptions()->SetExternalGuaranteeExclusivePK(*ExternalGuaranteeExclusivePK); + if (ScanReaderPolicyName) { + schemaData.MutableOptions()->SetScanReaderPolicyName(*ScanReaderPolicyName); } if (CompactionPlannerConstructor.HasObject()) { CompactionPlannerConstructor.SerializeToProto(*schemaData.MutableOptions()->MutableCompactionPlannerConstructor()); diff --git a/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.h b/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.h index 5b54adf9c172..ec678b69c73c 100644 --- a/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.h +++ b/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.h @@ -13,7 +13,7 @@ class TUpsertOptionsOperation: public ITableStoreOperation { static inline const auto Registrator = TFactory::TRegistrator(GetTypeName()); private: bool SchemeNeedActualization = false; - std::optional ExternalGuaranteeExclusivePK; + std::optional ScanReaderPolicyName; NOlap::NStorageOptimizer::TOptimizerPlannerConstructorContainer CompactionPlannerConstructor; NOlap::NDataAccessorControl::TMetadataManagerConstructorContainer MetadataManagerConstructor; public: diff --git a/ydb/core/kqp/ut/olap/aggregations_ut.cpp b/ydb/core/kqp/ut/olap/aggregations_ut.cpp index bf1921c5fe4b..eba7c4b65416 100644 --- a/ydb/core/kqp/ut/olap/aggregations_ut.cpp +++ b/ydb/core/kqp/ut/olap/aggregations_ut.cpp @@ -75,6 +75,33 @@ Y_UNIT_TEST_SUITE(KqpOlapAggregations) { Cout << result << Endl; CompareYson(result, R"([[23000u;]])"); } + + { + auto alterQuery = TStringBuilder() << + R"( + ALTER OBJECT `/Root/olapStore/olapTable` (TYPE TABLE) SET (ACTION=UPSERT_OPTIONS, `SCAN_READER_POLICY_NAME`=`SIMPLE`) + )"; + auto session = tableClient.CreateSession().GetValueSync().GetSession(); + auto alterResult = session.ExecuteSchemeQuery(alterQuery).GetValueSync(); + UNIT_ASSERT_VALUES_EQUAL_C(alterResult.GetStatus(), NYdb::EStatus::SUCCESS, alterResult.GetIssues().ToString()); + } + + { + auto it = tableClient + .StreamExecuteScanQuery(R"( + --!syntax_v1 + + SELECT + COUNT(*) + FROM `/Root/olapStore/olapTable` + )") + .GetValueSync(); + + UNIT_ASSERT_C(it.IsSuccess(), it.GetIssues().ToString()); + TString result = StreamResultToYson(it); + Cout << result << Endl; + CompareYson(result, R"([[23000u;]])"); + } } Y_UNIT_TEST(AggregationCountPushdown) { diff --git a/ydb/core/protos/flat_scheme_op.proto b/ydb/core/protos/flat_scheme_op.proto index ab530a8d2379..2e4d945df675 100644 --- a/ydb/core/protos/flat_scheme_op.proto +++ b/ydb/core/protos/flat_scheme_op.proto @@ -516,9 +516,9 @@ message TMetadataManagerConstructorContainer { message TColumnTableSchemeOptions { optional bool SchemeNeedActualization = 1 [default = false]; - optional bool ExternalGuaranteeExclusivePK = 2 [default = false]; optional TCompactionPlannerConstructorContainer CompactionPlannerConstructor = 3; optional TMetadataManagerConstructorContainer MetadataManagerConstructor = 4; + optional string ScanReaderPolicyName = 3; } message TColumnTableSchema { diff --git a/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h b/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h index 5d1a684e0217..3f02e616fff0 100644 --- a/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h +++ b/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h @@ -116,8 +116,8 @@ struct TReadMetadataBase { return ResultIndexSchema; } - bool HasGuaranteeExclusivePK() const { - return GetIndexInfo().GetExternalGuaranteeExclusivePK(); + bool GetScanReaderPolicyName(const TString& defaultName) const { + return GetIndexInfo().GetScanReaderPolicyName().value_or(defaultName); } ISnapshotSchema::TPtr GetLoadSchemaVerified(const TPortionInfo& porition) const; diff --git a/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp b/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp index 1e682656024e..b57fa57c6f89 100644 --- a/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp +++ b/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp @@ -63,8 +63,17 @@ void TTxScan::Complete(const TActorContext& ctx) { read.PathId = request.GetLocalPathId(); read.ReadNothing = !Self->TablesManager.HasTable(read.PathId); read.TableName = table; + const TString defaultReader = - AppDataVerified().ColumnShardConfig.GetReaderClassName() ? AppDataVerified().ColumnShardConfig.GetReaderClassName() : "PLAIN"; + [&]() { + const TString defGlobal = + AppDataVerified().ColumnShardConfig.GetReaderClassName() ? AppDataVerified().ColumnShardConfig.GetReaderClassName() : "PLAIN"; + if (Self->HasIndex()) { + return Self->GetIndexAs().GetVersionedIndex().GetLastSchema()->GetIndexInfo().GetScanReaderPolicyName(defGlobal); + } else { + return defGlobal; + } + }(); std::unique_ptr scannerConstructor = [&]() { auto sysViewPolicy = NSysView::NAbstract::ISysViewPolicy::BuildByPath(read.TableName); if (!sysViewPolicy) { diff --git a/ydb/core/tx/columnshard/engines/scheme/index_info.cpp b/ydb/core/tx/columnshard/engines/scheme/index_info.cpp index 310b52ce420b..ea7f6feaf027 100644 --- a/ydb/core/tx/columnshard/engines/scheme/index_info.cpp +++ b/ydb/core/tx/columnshard/engines/scheme/index_info.cpp @@ -181,7 +181,9 @@ std::shared_ptr TIndexInfo::GetColumnSchema(const ui32 columnId) void TIndexInfo::DeserializeOptionsFromProto(const NKikimrSchemeOp::TColumnTableSchemeOptions& optionsProto) { TMemoryProfileGuard g("TIndexInfo::DeserializeFromProto::Options"); SchemeNeedActualization = optionsProto.GetSchemeNeedActualization(); - ExternalGuaranteeExclusivePK = optionsProto.GetExternalGuaranteeExclusivePK(); + if (optionsProto.HasScanReaderPolicyName()) { + ScanReaderPolicyName = optionsProto.GetScanReaderPolicyName(); + } if (optionsProto.HasCompactionPlannerConstructor()) { auto container = NStorageOptimizer::TOptimizerPlannerConstructorContainer::BuildFromProto(optionsProto.GetCompactionPlannerConstructor()); diff --git a/ydb/core/tx/columnshard/engines/scheme/index_info.h b/ydb/core/tx/columnshard/engines/scheme/index_info.h index aa842f17bab5..9d27f0015971 100644 --- a/ydb/core/tx/columnshard/engines/scheme/index_info.h +++ b/ydb/core/tx/columnshard/engines/scheme/index_info.h @@ -104,7 +104,7 @@ struct TIndexInfo: public IIndexInfo { bool SchemeNeedActualization = false; std::shared_ptr CompactionPlannerConstructor; std::shared_ptr MetadataManagerConstructor; - bool ExternalGuaranteeExclusivePK = false; + std::optional ScanReaderPolicyName; ui64 Version = 0; std::vector SchemaColumnIds; @@ -215,8 +215,8 @@ struct TIndexInfo: public IIndexInfo { std::shared_ptr GetColumnExternalDefaultValueVerified(const ui32 colId) const; std::shared_ptr GetColumnExternalDefaultValueByIndexVerified(const ui32 colIndex) const; - bool GetExternalGuaranteeExclusivePK() const { - return ExternalGuaranteeExclusivePK; + const std::optional& GetScanReaderPolicyName() const { + return ScanReaderPolicyName; } const TColumnFeatures& GetColumnFeaturesVerified(const ui32 columnId) const { diff --git a/ydb/core/tx/schemeshard/olap/options/schema.cpp b/ydb/core/tx/schemeshard/olap/options/schema.cpp index c40699e6cc2c..59f9df521f34 100644 --- a/ydb/core/tx/schemeshard/olap/options/schema.cpp +++ b/ydb/core/tx/schemeshard/olap/options/schema.cpp @@ -4,8 +4,8 @@ namespace NKikimr::NSchemeShard { bool TOlapOptionsDescription::ApplyUpdate(const TOlapOptionsUpdate& schemaUpdate, IErrorCollector& /*errors*/) { SchemeNeedActualization = schemaUpdate.GetSchemeNeedActualization(); - if (!!schemaUpdate.GetExternalGuaranteeExclusivePK()) { - ExternalGuaranteeExclusivePK = *schemaUpdate.GetExternalGuaranteeExclusivePK(); + if (!!schemaUpdate.GetScanReaderPolicyName()) { + ScanReaderPolicyName = *schemaUpdate.GetScanReaderPolicyName(); } if (schemaUpdate.GetCompactionPlannerConstructor().HasObject()) { CompactionPlannerConstructor = schemaUpdate.GetCompactionPlannerConstructor(); @@ -18,8 +18,8 @@ bool TOlapOptionsDescription::ApplyUpdate(const TOlapOptionsUpdate& schemaUpdate void TOlapOptionsDescription::Parse(const NKikimrSchemeOp::TColumnTableSchema& tableSchema) { SchemeNeedActualization = tableSchema.GetOptions().GetSchemeNeedActualization(); - if (tableSchema.GetOptions().HasExternalGuaranteeExclusivePK()) { - ExternalGuaranteeExclusivePK = tableSchema.GetOptions().GetExternalGuaranteeExclusivePK(); + if (tableSchema.GetOptions().HasScanReaderPolicyName()) { + ScanReaderPolicyName = tableSchema.GetOptions().GetScanReaderPolicyName(); } if (tableSchema.GetOptions().HasCompactionPlannerConstructor()) { AFL_VERIFY(CompactionPlannerConstructor.DeserializeFromProto(tableSchema.GetOptions().GetCompactionPlannerConstructor())); @@ -31,8 +31,8 @@ void TOlapOptionsDescription::Parse(const NKikimrSchemeOp::TColumnTableSchema& t void TOlapOptionsDescription::Serialize(NKikimrSchemeOp::TColumnTableSchema& tableSchema) const { tableSchema.MutableOptions()->SetSchemeNeedActualization(SchemeNeedActualization); - if (ExternalGuaranteeExclusivePK) { - tableSchema.MutableOptions()->SetExternalGuaranteeExclusivePK(ExternalGuaranteeExclusivePK); + if (ScanReaderPolicyName) { + tableSchema.MutableOptions()->SetScanReaderPolicyName(*ScanReaderPolicyName); } if (CompactionPlannerConstructor.HasObject()) { CompactionPlannerConstructor.SerializeToProto(*tableSchema.MutableOptions()->MutableCompactionPlannerConstructor()); diff --git a/ydb/core/tx/schemeshard/olap/options/schema.h b/ydb/core/tx/schemeshard/olap/options/schema.h index 12a5fcedf6b1..070bd16437e7 100644 --- a/ydb/core/tx/schemeshard/olap/options/schema.h +++ b/ydb/core/tx/schemeshard/olap/options/schema.h @@ -8,7 +8,7 @@ class TOlapSchema; class TOlapOptionsDescription { private: YDB_READONLY(bool, SchemeNeedActualization, false); - YDB_READONLY(bool, ExternalGuaranteeExclusivePK, false); + YDB_READONLY_DEF(std::optional, ScanReaderPolicyName); YDB_READONLY_DEF(NOlap::NStorageOptimizer::TOptimizerPlannerConstructorContainer, CompactionPlannerConstructor); YDB_READONLY_DEF(NOlap::NDataAccessorControl::TMetadataManagerConstructorContainer, MetadataManagerConstructor); public: diff --git a/ydb/core/tx/schemeshard/olap/options/update.h b/ydb/core/tx/schemeshard/olap/options/update.h index 192b956a8b29..14dbd96cbd33 100644 --- a/ydb/core/tx/schemeshard/olap/options/update.h +++ b/ydb/core/tx/schemeshard/olap/options/update.h @@ -12,14 +12,14 @@ namespace NKikimr::NSchemeShard { class TOlapOptionsUpdate { private: YDB_ACCESSOR(bool, SchemeNeedActualization, false); - YDB_ACCESSOR_DEF(std::optional, ExternalGuaranteeExclusivePK); + YDB_ACCESSOR_DEF(std::optional, ScanReaderPolicyName); YDB_ACCESSOR_DEF(NOlap::NStorageOptimizer::TOptimizerPlannerConstructorContainer, CompactionPlannerConstructor); YDB_ACCESSOR_DEF(NOlap::NDataAccessorControl::TMetadataManagerConstructorContainer, MetadataManagerConstructor); public: bool Parse(const NKikimrSchemeOp::TAlterColumnTableSchema& alterRequest, IErrorCollector& errors) { SchemeNeedActualization = alterRequest.GetOptions().GetSchemeNeedActualization(); - if (alterRequest.GetOptions().HasExternalGuaranteeExclusivePK()) { - ExternalGuaranteeExclusivePK = alterRequest.GetOptions().GetExternalGuaranteeExclusivePK(); + if (alterRequest.GetOptions().HasScanReaderPolicyName()) { + ScanReaderPolicyName = alterRequest.GetOptions().GetScanReaderPolicyName(); } if (alterRequest.GetOptions().HasMetadataManagerConstructor()) { auto container = NOlap::NDataAccessorControl::TMetadataManagerConstructorContainer::BuildFromProto(alterRequest.GetOptions().GetMetadataManagerConstructor()); @@ -41,8 +41,8 @@ class TOlapOptionsUpdate { } void SerializeToProto(NKikimrSchemeOp::TAlterColumnTableSchema& alterRequest) const { alterRequest.MutableOptions()->SetSchemeNeedActualization(SchemeNeedActualization); - if (ExternalGuaranteeExclusivePK) { - alterRequest.MutableOptions()->SetExternalGuaranteeExclusivePK(*ExternalGuaranteeExclusivePK); + if (ScanReaderPolicyName) { + alterRequest.MutableOptions()->SetScanReaderPolicyName(*ScanReaderPolicyName); } if (CompactionPlannerConstructor.HasObject()) { CompactionPlannerConstructor.SerializeToProto(*alterRequest.MutableOptions()->MutableCompactionPlannerConstructor()); From 81b273f9b4807d47b927c9eb1fab8529530d552e Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Mon, 9 Dec 2024 12:54:30 +0300 Subject: [PATCH 2/4] fixes --- ydb/core/protos/flat_scheme_op.proto | 4 ++-- .../tx/columnshard/engines/reader/abstract/read_metadata.h | 4 ---- .../engines/reader/plain_reader/iterator/merge.cpp | 2 +- .../engines/reader/plain_reader/iterator/scanner.cpp | 4 +--- .../tx/columnshard/engines/reader/transaction/tx_scan.cpp | 7 ++++++- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ydb/core/protos/flat_scheme_op.proto b/ydb/core/protos/flat_scheme_op.proto index 2e4d945df675..37b86d7193a5 100644 --- a/ydb/core/protos/flat_scheme_op.proto +++ b/ydb/core/protos/flat_scheme_op.proto @@ -518,7 +518,7 @@ message TColumnTableSchemeOptions { optional bool SchemeNeedActualization = 1 [default = false]; optional TCompactionPlannerConstructorContainer CompactionPlannerConstructor = 3; optional TMetadataManagerConstructorContainer MetadataManagerConstructor = 4; - optional string ScanReaderPolicyName = 3; + optional string ScanReaderPolicyName = 5; } message TColumnTableSchema { @@ -560,9 +560,9 @@ message TColumnTableSchemaDiff { message TColumnTableRequestedOptions { optional bool SchemeNeedActualization = 1 [default = false]; - optional bool ExternalGuaranteeExclusivePK = 2; optional TCompactionPlannerConstructorContainer CompactionPlannerConstructor = 3; optional TMetadataManagerConstructorContainer MetadataManagerConstructor = 4; + optional string ScanReaderPolicyName = 5; } message TAlterColumnTableSchema { diff --git a/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h b/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h index 3f02e616fff0..b380483d589c 100644 --- a/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h +++ b/ydb/core/tx/columnshard/engines/reader/abstract/read_metadata.h @@ -116,10 +116,6 @@ struct TReadMetadataBase { return ResultIndexSchema; } - bool GetScanReaderPolicyName(const TString& defaultName) const { - return GetIndexInfo().GetScanReaderPolicyName().value_or(defaultName); - } - ISnapshotSchema::TPtr GetLoadSchemaVerified(const TPortionInfo& porition) const; const std::shared_ptr& GetBlobSchema(const ui64 version) const { diff --git a/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/merge.cpp b/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/merge.cpp index edea4214e298..479eae69d0bf 100644 --- a/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/merge.cpp +++ b/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/merge.cpp @@ -85,7 +85,7 @@ TConclusionStatus TStartMergeTask::DoExecuteImpl() { break; } } - if ((MergingContext->IsExclusiveInterval() || Context->GetCommonContext()->GetReadMetadata()->HasGuaranteeExclusivePK()) && + if ((MergingContext->IsExclusiveInterval()) && sourcesInMemory) { TMemoryProfileGuard mGuard("SCAN_PROFILE::MERGE::EXCLUSIVE", IS_DEBUG_LOG_ENABLED(NKikimrServices::TX_COLUMNSHARD_SCAN_MEMORY)); auto& container = Sources.begin()->second->GetStageResult().GetBatch(); diff --git a/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/scanner.cpp b/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/scanner.cpp index 3f439aa97129..912969520bc0 100644 --- a/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/scanner.cpp +++ b/ydb/core/tx/columnshard/engines/reader/plain_reader/iterator/scanner.cpp @@ -70,7 +70,6 @@ void TScanHead::OnIntervalResult(std::shared_ptrGetCommonContext()->GetReadMetadata()->HasGuaranteeExclusivePK(); TScanContext context; for (auto itPoint = BorderPoints.begin(); itPoint != BorderPoints.end(); ++itPoint) { auto& point = itPoint->second; @@ -82,8 +81,7 @@ TConclusionStatus TScanHead::Start() { } const bool isExclusive = context.GetCurrentSources().size() == 1; for (auto&& i : context.GetCurrentSources()) { - i.second->SetExclusiveIntervalOnly( - (isExclusive && i.second->GetExclusiveIntervalOnly() && !context.GetIsSpecialPoint()) || guaranteeExclusivePK); + i.second->SetExclusiveIntervalOnly((isExclusive && i.second->GetExclusiveIntervalOnly() && !context.GetIsSpecialPoint())); } for (auto&& i : point.GetFinishSources()) { diff --git a/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp b/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp index b57fa57c6f89..8fa9698a11e0 100644 --- a/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp +++ b/ydb/core/tx/columnshard/engines/reader/transaction/tx_scan.cpp @@ -69,7 +69,12 @@ void TTxScan::Complete(const TActorContext& ctx) { const TString defGlobal = AppDataVerified().ColumnShardConfig.GetReaderClassName() ? AppDataVerified().ColumnShardConfig.GetReaderClassName() : "PLAIN"; if (Self->HasIndex()) { - return Self->GetIndexAs().GetVersionedIndex().GetLastSchema()->GetIndexInfo().GetScanReaderPolicyName(defGlobal); + return Self->GetIndexAs() + .GetVersionedIndex() + .GetLastSchema() + ->GetIndexInfo() + .GetScanReaderPolicyName() + .value_or(defGlobal); } else { return defGlobal; } From fecd48d501aae274d531c66c5a89ecb12b814173 Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Mon, 9 Dec 2024 13:14:41 +0300 Subject: [PATCH 3/4] fix --- .../kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp b/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp index 651028307434..edd38142ba2b 100644 --- a/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp +++ b/ydb/core/kqp/gateway/behaviour/tablestore/operations/upsert_opt.cpp @@ -10,7 +10,7 @@ TConclusionStatus TUpsertOptionsOperation::DoDeserialize(NYql::TObjectSettingsIm return TConclusionStatus::Fail("Incorrect value for SCHEME_NEED_ACTUALIZATION: cannot parse as boolean"); } SchemeNeedActualization = *value; - ScanReaderPolicyName = features.Extract("SCAN_READER_POLICY_NAME"); + ScanReaderPolicyName = features.Extract("SCAN_READER_POLICY_NAME"); if (ScanReaderPolicyName) { if (*ScanReaderPolicyName != "PLAIN" && *ScanReaderPolicyName != "SIMPLE") { return TConclusionStatus::Fail("SCAN_READER_POLICY_NAME have to be in ['PLAIN', 'SIMPLE']"); From e906220fd77c8c004b2430e96e90147ba2c7dc9f Mon Sep 17 00:00:00 2001 From: ivanmorozov333 Date: Mon, 9 Dec 2024 13:28:07 +0300 Subject: [PATCH 4/4] fix test --- ydb/core/kqp/ut/olap/aggregations_ut.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/core/kqp/ut/olap/aggregations_ut.cpp b/ydb/core/kqp/ut/olap/aggregations_ut.cpp index eba7c4b65416..dfa8fbd078fd 100644 --- a/ydb/core/kqp/ut/olap/aggregations_ut.cpp +++ b/ydb/core/kqp/ut/olap/aggregations_ut.cpp @@ -79,7 +79,7 @@ Y_UNIT_TEST_SUITE(KqpOlapAggregations) { { auto alterQuery = TStringBuilder() << R"( - ALTER OBJECT `/Root/olapStore/olapTable` (TYPE TABLE) SET (ACTION=UPSERT_OPTIONS, `SCAN_READER_POLICY_NAME`=`SIMPLE`) + ALTER OBJECT `/Root/olapStore` (TYPE TABLESTORE) SET (ACTION=UPSERT_OPTIONS, `SCAN_READER_POLICY_NAME`=`SIMPLE`) )"; auto session = tableClient.CreateSession().GetValueSync().GetSession(); auto alterResult = session.ExecuteSchemeQuery(alterQuery).GetValueSync();