aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorssmike <ssmike@ydb.tech>2022-12-10 12:32:21 +0300
committerssmike <ssmike@ydb.tech>2022-12-10 12:32:21 +0300
commit8e003675e20f29143ae6088e4beebfa7256c825c (patch)
tree86800f2a178d7189e87ae8c016a55b0ea3370cd3
parent67bbe255510b60f6ea0aca30d61bec59bf05ff0d (diff)
downloadydb-8e003675e20f29143ae6088e4beebfa7256c825c.tar.gz
Move flags to TableServiceConfig
-rw-r--r--ydb/core/kqp/compile_service/kqp_compile_actor.cpp2
-rw-r--r--ydb/core/kqp/opt/physical/kqp_opt_phy_build_stage.cpp8
-rw-r--r--ydb/core/kqp/provider/yql_kikimr_settings.h3
-rw-r--r--ydb/core/kqp/ut/kqp_ne_ut.cpp10
-rw-r--r--ydb/core/kqp/ut/kqp_scan_ut.cpp12
-rw-r--r--ydb/core/protos/config.proto7
6 files changed, 31 insertions, 11 deletions
diff --git a/ydb/core/kqp/compile_service/kqp_compile_actor.cpp b/ydb/core/kqp/compile_service/kqp_compile_actor.cpp
index a126e199ac2..b2170703a51 100644
--- a/ydb/core/kqp/compile_service/kqp_compile_actor.cpp
+++ b/ydb/core/kqp/compile_service/kqp_compile_actor.cpp
@@ -56,6 +56,8 @@ public:
, CompileActorSpan(TWilsonKqp::CompileActor, std::move(traceId), "CompileActor")
{
Config->Init(kqpSettings->DefaultSettings.GetDefaultSettings(), Query.Cluster, kqpSettings->Settings, false);
+ Config->EnableKqpDataQuerySourceRead = serviceConfig.GetEnableKqpDataQuerySourceRead();
+ Config->EnableKqpScanQuerySourceRead = serviceConfig.GetEnableKqpScanQuerySourceRead();
if (!Query.Database.empty()) {
Config->_KqpTablePathPrefix = Query.Database;
diff --git a/ydb/core/kqp/opt/physical/kqp_opt_phy_build_stage.cpp b/ydb/core/kqp/opt/physical/kqp_opt_phy_build_stage.cpp
index 8141a476843..ef3ff6eb02e 100644
--- a/ydb/core/kqp/opt/physical/kqp_opt_phy_build_stage.cpp
+++ b/ydb/core/kqp/opt/physical/kqp_opt_phy_build_stage.cpp
@@ -59,8 +59,8 @@ TExprBase KqpBuildReadTableStage(TExprBase node, TExprContext& ctx, const TKqpOp
return node;
}
const TKqlReadTable& read = node.Cast<TKqlReadTable>();
- bool useSource = kqpCtx.Config->FeatureFlags.GetEnableKqpScanQuerySourceRead() && kqpCtx.IsScanQuery();
- useSource = useSource || (kqpCtx.Config->FeatureFlags.GetEnableKqpDataQuerySourceRead() && kqpCtx.IsDataQuery());
+ bool useSource = kqpCtx.Config->EnableKqpScanQuerySourceRead && kqpCtx.IsScanQuery();
+ useSource = useSource || (kqpCtx.Config->EnableKqpDataQuerySourceRead && kqpCtx.IsDataQuery());
TVector<TExprBase> values;
TNodeOnNodeOwnedMap replaceMap;
@@ -225,8 +225,8 @@ TExprBase KqpBuildReadTableRangesStage(TExprBase node, TExprContext& ctx,
auto ranges = read.Ranges();
auto& tableDesc = kqpCtx.Tables->ExistingTable(kqpCtx.Cluster, read.Table().Path());
- bool useSource = kqpCtx.Config->FeatureFlags.GetEnableKqpScanQuerySourceRead() && kqpCtx.IsScanQuery();
- useSource = useSource || (kqpCtx.Config->FeatureFlags.GetEnableKqpDataQuerySourceRead() && kqpCtx.IsDataQuery());
+ bool useSource = kqpCtx.Config->EnableKqpScanQuerySourceRead && kqpCtx.IsScanQuery();
+ useSource = useSource || (kqpCtx.Config->EnableKqpDataQuerySourceRead && kqpCtx.IsDataQuery());
bool fullScan = TCoVoid::Match(ranges.Raw());
TVector<TExprBase> input;
diff --git a/ydb/core/kqp/provider/yql_kikimr_settings.h b/ydb/core/kqp/provider/yql_kikimr_settings.h
index b92b04677a5..6a9e33b1a16 100644
--- a/ydb/core/kqp/provider/yql_kikimr_settings.h
+++ b/ydb/core/kqp/provider/yql_kikimr_settings.h
@@ -127,6 +127,9 @@ struct TKikimrConfiguration : public TKikimrSettings, public NCommon::TSettingDi
TKikimrSettings::TConstPtr Snapshot() const;
NKikimrConfig::TFeatureFlags FeatureFlags;
+
+ bool EnableKqpScanQuerySourceRead = false;
+ bool EnableKqpDataQuerySourceRead = false;
};
}
diff --git a/ydb/core/kqp/ut/kqp_ne_ut.cpp b/ydb/core/kqp/ut/kqp_ne_ut.cpp
index 3f46b7cc342..f8fa2ef0179 100644
--- a/ydb/core/kqp/ut/kqp_ne_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_ne_ut.cpp
@@ -3428,11 +3428,14 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSource) {
TKikimrSettings settings;
+ NKikimrConfig::TAppConfig appConfig;
+ appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
TFeatureFlags flags;
flags.SetEnablePredicateExtractForDataQueries(true);
- flags.SetEnableKqpDataQuerySourceRead(true);
settings.SetFeatureFlags(flags);
+ settings.SetAppConfig(appConfig);
+
TKikimrRunner kikimr(settings);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -3448,11 +3451,14 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSourceLiteralRange) {
TKikimrSettings settings;
+ NKikimrConfig::TAppConfig appConfig;
+ appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
TFeatureFlags flags;
flags.SetEnablePredicateExtractForDataQueries(true);
- flags.SetEnableKqpDataQuerySourceRead(true);
settings.SetFeatureFlags(flags);
+ settings.SetAppConfig(appConfig);
+
TKikimrRunner kikimr(settings);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
diff --git a/ydb/core/kqp/ut/kqp_scan_ut.cpp b/ydb/core/kqp/ut/kqp_scan_ut.cpp
index 96f85620de3..81441d0f0c9 100644
--- a/ydb/core/kqp/ut/kqp_scan_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_scan_ut.cpp
@@ -1973,11 +1973,14 @@ Y_UNIT_TEST_SUITE(KqpScan) {
Y_UNIT_TEST(DqSource) {
TKikimrSettings settings;
+ NKikimrConfig::TAppConfig appConfig;
+ appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
TFeatureFlags flags;
- flags.SetEnablePredicateExtractForDataQueries(true);
- flags.SetEnableKqpScanQuerySourceRead(true);
+ flags.SetEnablePredicateExtractForScanQueries(true);
settings.SetFeatureFlags(flags);
+ settings.SetAppConfig(appConfig);
+
TKikimrRunner kikimr(settings);
auto db = kikimr.GetTableClient();
CreateSampleTables(kikimr);
@@ -1993,11 +1996,14 @@ Y_UNIT_TEST_SUITE(KqpScan) {
Y_UNIT_TEST(DqSourceLiteralRange) {
TKikimrSettings settings;
+ NKikimrConfig::TAppConfig appConfig;
+ appConfig.MutableTableServiceConfig()->SetEnableKqpScanQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
TFeatureFlags flags;
flags.SetEnablePredicateExtractForDataQueries(true);
- flags.SetEnableKqpScanQuerySourceRead(true);
settings.SetFeatureFlags(flags);
+ settings.SetAppConfig(appConfig);
+
TKikimrRunner kikimr(settings);
auto db = kikimr.GetTableClient();
CreateSampleTables(kikimr);
diff --git a/ydb/core/protos/config.proto b/ydb/core/protos/config.proto
index 56b02307f98..3c859de59e0 100644
--- a/ydb/core/protos/config.proto
+++ b/ydb/core/protos/config.proto
@@ -750,14 +750,14 @@ message TFeatureFlags {
optional bool EnableKqpDataQueryStreamLookup = 75 [default = false];
optional bool EnableBorrowedSplitCompaction = 76 [default = true];
optional bool EnableChangefeedInitialScan = 77 [default = false];
- optional bool EnableKqpScanQuerySourceRead = 78 [default = false];
+ reserved 78; // EnableKqpScanQuerySourceRead
optional bool EnableDynamicNodeAuthorization = 79 [default = false];
optional bool EnableKqpImmediateEffects = 80 [default = false];
optional bool EnableDataShardGenericReadSets = 81 [default = false];
// enable alter database operation to create subdomain's system tablets
// directly in subdomain's hive
optional bool EnableAlterDatabaseCreateHiveFirst = 82 [default = false];
- optional bool EnableKqpDataQuerySourceRead = 83 [default = false];
+ reserved 83; // EnableKqpDataQuerySourceRead
optional bool EnableSmallDiskOptimization = 84 [default = true];
}
@@ -1209,6 +1209,9 @@ message TTableServiceConfig {
reserved 23; // optional bool EnableKqpSessionActor = 23 [default = true];
reserved 24; // optional bool EnableKqpPatternCacheLiteral = 24 [default = false];
reserved 25; // optional bool EnableKqpPatternCacheCompute = 25 [default = false];
+
+ optional bool EnableKqpScanQuerySourceRead = 26 [default = false];
+ optional bool EnableKqpDataQuerySourceRead = 27 [default = false];
};
// Config describes immediate controls and allows