Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "add enable implicit params flag to table service config" #6682

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions ydb/core/kqp/compile_service/kqp_compile_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -523,11 +523,6 @@ class TKqpCompileService : public TActorBootstrapped<TKqpCompileService> {
bool enableCreateTableAs = TableServiceConfig.GetEnableCreateTableAs();
auto blockChannelsMode = TableServiceConfig.GetBlockChannelsMode();

bool enableAstCache = TableServiceConfig.GetEnableAstCache();
bool enableImplicitQueryParameterTypes = TableServiceConfig.GetEnableImplicitQueryParameterTypes();
bool enablePgConstsToParams = TableServiceConfig.GetEnablePgConstsToParams();
bool enablePerStatementQueryExecution = TableServiceConfig.GetEnablePerStatementQueryExecution();

auto mkqlHeavyLimit = TableServiceConfig.GetResourceManager().GetMkqlHeavyProgramMemoryLimit();

bool enableQueryServiceSpilling = TableServiceConfig.GetEnableQueryServiceSpilling();
Expand Down Expand Up @@ -558,11 +553,7 @@ class TKqpCompileService : public TActorBootstrapped<TKqpCompileService> {
TableServiceConfig.GetIdxLookupJoinPointsLimit() != idxLookupPointsLimit ||
TableServiceConfig.GetEnableQueryServiceSpilling() != enableQueryServiceSpilling ||
TableServiceConfig.GetDefaultCostBasedOptimizationLevel() != defaultCostBasedOptimizationLevel ||
TableServiceConfig.GetEnableConstantFolding() != enableConstantFolding ||
TableServiceConfig.GetEnableAstCache() != enableAstCache ||
TableServiceConfig.GetEnableImplicitQueryParameterTypes() != enableImplicitQueryParameterTypes ||
TableServiceConfig.GetEnablePgConstsToParams() != enablePgConstsToParams ||
TableServiceConfig.GetEnablePerStatementQueryExecution() != enablePerStatementQueryExecution) {
TableServiceConfig.GetEnableConstantFolding() != enableConstantFolding) {

QueryCache.Clear();

Expand Down
3 changes: 2 additions & 1 deletion ydb/core/kqp/session_actor/kqp_query_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class TKqpQueryState : public TNonCopyable {
, StartedAt(startedAt)
{
RequestEv.reset(ev->Release().Release());
if (tableServiceConfig.GetEnableImplicitQueryParameterTypes() && !RequestEv->GetYdbParameters().empty()) {

if (AppData()->FeatureFlags.GetEnableImplicitQueryParameterTypes() && !RequestEv->GetYdbParameters().empty()) {
QueryParameterTypes = std::make_shared<std::map<TString, Ydb::Type>>();
for (const auto& [name, typedValue] : RequestEv->GetYdbParameters()) {
QueryParameterTypes->insert({name, typedValue.Gettype()});
Expand Down
48 changes: 12 additions & 36 deletions ydb/core/kqp/ut/query/kqp_params_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,8 @@ Y_UNIT_TEST_SUITE(KqpParams) {
}

Y_UNIT_TEST(ImplicitParameterTypes) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableImplicitQueryParameterTypes(true);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
.SetKqpSettings({NKikimrKqp::TKqpSetting()});
TKikimrRunner kikimr(serverSettings);
TKikimrRunner kikimr;
kikimr.GetTestServer().GetRuntime()->GetAppData(0).FeatureFlags.SetEnableImplicitQueryParameterTypes(true);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand All @@ -131,12 +127,8 @@ Y_UNIT_TEST_SUITE(KqpParams) {

Y_UNIT_TEST(CheckQueryCacheForPreparedQuery) {
// All params are declared in the text
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableImplicitQueryParameterTypes(true);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
.SetKqpSettings({NKikimrKqp::TKqpSetting()});
TKikimrRunner kikimr(serverSettings);
TKikimrRunner kikimr;
kikimr.GetTestServer().GetRuntime()->GetAppData(0).FeatureFlags.SetEnableImplicitQueryParameterTypes(true);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -172,12 +164,8 @@ Y_UNIT_TEST_SUITE(KqpParams) {

Y_UNIT_TEST(CheckQueryCacheForUnpreparedQuery) {
// Some params are declared in text, some by user
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableImplicitQueryParameterTypes(true);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
.SetKqpSettings({NKikimrKqp::TKqpSetting()});
TKikimrRunner kikimr(serverSettings);
TKikimrRunner kikimr;
kikimr.GetTestServer().GetRuntime()->GetAppData(0).FeatureFlags.SetEnableImplicitQueryParameterTypes(true);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -296,12 +284,8 @@ Y_UNIT_TEST_SUITE(KqpParams) {

Y_UNIT_TEST(CheckQueryCacheForExecuteAndPreparedQueries) {
// All params are declared in the text
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableImplicitQueryParameterTypes(true);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
.SetKqpSettings({NKikimrKqp::TKqpSetting()});
TKikimrRunner kikimr(serverSettings);
TKikimrRunner kikimr;
kikimr.GetTestServer().GetRuntime()->GetAppData(0).FeatureFlags.SetEnableImplicitQueryParameterTypes(true);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -509,12 +493,8 @@ Y_UNIT_TEST_SUITE(KqpParams) {
}

Y_UNIT_TEST(ImplicitSameParameterTypesQueryCacheCheck) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableImplicitQueryParameterTypes(true);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
.SetKqpSettings({NKikimrKqp::TKqpSetting()});
TKikimrRunner kikimr(serverSettings);
TKikimrRunner kikimr;
kikimr.GetTestServer().GetRuntime()->GetAppData(0).FeatureFlags.SetEnableImplicitQueryParameterTypes(true);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand All @@ -539,12 +519,8 @@ Y_UNIT_TEST_SUITE(KqpParams) {
}

Y_UNIT_TEST(ImplicitDifferentParameterTypesQueryCacheCheck) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableImplicitQueryParameterTypes(true);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
.SetKqpSettings({NKikimrKqp::TKqpSetting()});
TKikimrRunner kikimr(serverSettings);
TKikimrRunner kikimr;
kikimr.GetTestServer().GetRuntime()->GetAppData(0).FeatureFlags.SetEnableImplicitQueryParameterTypes(true);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down
2 changes: 1 addition & 1 deletion ydb/core/protos/feature_flags.proto
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ message TFeatureFlags {
optional bool EnableSeparationComputeActorsFromRead = 90 [default = true];
optional bool EnablePQConfigTransactionsAtSchemeShard = 91 [default = false];
optional bool EnableScriptExecutionOperations = 92 [default = true];
reserved 93; // optional bool EnableImplicitQueryParameterTypes = 93 [default = true];
optional bool EnableImplicitQueryParameterTypes = 93 [default = true];
optional bool EnableForceImmediateEffectsExecution = 94 [default = false];
optional bool EnableTopicSplitMerge = 95 [default = false];
optional bool EnableChangefeedDynamoDBStreamsFormat = 96 [default = true];
Expand Down
3 changes: 1 addition & 2 deletions ydb/core/protos/table_service_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,5 @@ message TTableServiceConfig {
optional uint32 DefaultCostBasedOptimizationLevel = 64 [default = 3];

optional bool EnableConstantFolding = 65 [ default = true ];

optional bool EnableImplicitQueryParameterTypes = 66 [ default = true ];

};
Loading