Skip to content

Commit f8071d3

Browse files
committed
Fixed PR comments ydb-platform#1
1 parent 7fd2dec commit f8071d3

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

ydb/core/fq/libs/compute/common/config.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ class TComputeConfig {
2828
"Activation percentage must be either 0 or 100");
2929
}
3030
}
31-
for (size_t i = 0; i < ComputeConfig.SupportedComputeYDBFeaturesSize(); ++i) {
32-
SupportedSyntaxFeatures.insert(ComputeConfig.GetSupportedComputeYDBFeatures(i));
33-
}
3431
}
3532

3633
NFq::NConfig::EComputeType GetComputeType(const FederatedQuery::QueryContent::QueryType queryType, const TString& scope) const {
@@ -176,14 +173,13 @@ class TComputeConfig {
176173
}
177174
}
178175

179-
[[nodiscard]] bool IsYDBSyntaxFeatureSupported(NConfig::ESupportedComputeYDBFeatures feature) const {
180-
return SupportedSyntaxFeatures.contains(feature);
176+
[[nodiscard]] bool IsReplaceIfExistsSyntaxSupported() const {
177+
return ComputeConfig.GetSupportedComputeYDBFeatures().GetReplaceIfExists();
181178
}
182179

183180
private:
184181
NFq::NConfig::TComputeConfig ComputeConfig;
185182
NFq::NConfig::EComputeType DefaultCompute;
186-
std::unordered_set<NConfig::ESupportedComputeYDBFeatures> SupportedSyntaxFeatures{};
187183
};
188184

189185
} /* NFq */

ydb/core/fq/libs/config/protos/compute.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ message TComputeMapping {
8383
TActivationPercentage Activation = 3;
8484
}
8585

86-
enum ESupportedComputeYDBFeatures {
87-
REPLACE_IF_EXISTS = 0;
86+
message TSupportedComputeYDBFeatures {
87+
bool ReplaceIfExists = 1;
8888
}
8989

9090
message TComputeConfig {
9191
TInPlaceCompute InPlace = 1;
9292
TYdbCompute Ydb = 2;
9393
EComputeType DefaultCompute = 3;
9494
repeated TComputeMapping ComputeMapping = 4;
95-
repeated ESupportedComputeYDBFeatures SupportedComputeYDBFeatures = 5;
95+
TSupportedComputeYDBFeatures SupportedComputeYDBFeatures = 5;
9696
}

ydb/core/fq/libs/control_plane_proxy/actors/ydb_schema_query_actor.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ IActor* MakeCreateConnectionActor(
575575
statements.push_back(TSchemaQueryTask{
576576
.SQL = MakeCreateExternalDataSourceQuery(
577577
connectionContent, signer, commonConfig,
578-
computeConfig.IsYDBSyntaxFeatureSupported(REPLACE_IF_EXISTS)),
578+
computeConfig.IsReplaceIfExistsSyntaxSupported()),
579579
.ScheduleErrorRecoverySQLGeneration =
580580
withoutRollback ? NoRecoverySQLGeneration()
581581
: alreadyExistRecoveryActorFactoryMethod,
@@ -636,7 +636,7 @@ NActors::IActor* MakeModifyConnectionActor(
636636
newConnectionContent.name(),
637637
signer);
638638

639-
bool replaceSupported = computeConfig.IsYDBSyntaxFeatureSupported(REPLACE_IF_EXISTS);
639+
bool replaceSupported = computeConfig.IsReplaceIfExistsSyntaxSupported();
640640
if (replaceSupported &&
641641
oldConnectionContent.name() == newConnectionContent.name()) {
642642
// CREATE OR REPLACE
@@ -833,7 +833,7 @@ NActors::IActor* MakeCreateBindingActor(
833833
statements.push_back(TSchemaQueryTask{
834834
.SQL = TString{MakeCreateExternalDataTableQuery(
835835
bindingContent, externalSourceName,
836-
computeConfig.IsYDBSyntaxFeatureSupported(REPLACE_IF_EXISTS))},
836+
computeConfig.IsReplaceIfExistsSyntaxSupported())},
837837
.ScheduleErrorRecoverySQLGeneration =
838838
withoutRollback ? NoRecoverySQLGeneration()
839839
: alreadyExistRecoveryActorFactoryMethod,
@@ -881,7 +881,7 @@ NActors::IActor* MakeModifyBindingActor(
881881
auto sourceName = request->Get()->ConnectionContent->name();
882882
auto oldTableName = request->Get()->OldBindingContent->name();
883883

884-
bool replaceSupported = computeConfig.IsYDBSyntaxFeatureSupported(REPLACE_IF_EXISTS);
884+
bool replaceSupported = computeConfig.IsReplaceIfExistsSyntaxSupported();
885885
if (replaceSupported &&
886886
oldTableName == request->Get()->Request.content().name()) {
887887
// CREATE OR REPLACE

0 commit comments

Comments
 (0)