summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVitalii Gridnev <[email protected]>2024-07-10 16:22:00 +0400
committerGitHub <[email protected]>2024-07-10 16:22:00 +0400
commit090a8c8feeddc3c550caf81284b772f28dcd1202 (patch)
tree17fb7e98309d7780dae2951cc9f1a22d73d9e66c
parent0c72d379633727d08eb971664b87f91d72ada941 (diff)
remove feature flag: modify tests to remove source reads feature flag (#6505)
-rw-r--r--ydb/core/kqp/ut/cost/kqp_cost_ut.cpp22
-rw-r--r--ydb/core/kqp/ut/effects/kqp_inplace_update_ut.cpp98
-rw-r--r--ydb/core/kqp/ut/indexes/kqp_indexes_multishard_ut.cpp10
-rw-r--r--ydb/core/kqp/ut/opt/kqp_ne_ut.cpp26
-rw-r--r--ydb/core/kqp/ut/opt/kqp_sort_ut.cpp7
-rw-r--r--ydb/core/kqp/ut/query/kqp_explain_ut.cpp3
-rw-r--r--ydb/core/kqp/ut/query/kqp_limits_ut.cpp12
-rw-r--r--ydb/core/kqp/ut/query/kqp_query_ut.cpp122
-rw-r--r--ydb/core/sys_view/ut_common.cpp3
-rw-r--r--ydb/core/sys_view/ut_common.h8
-rw-r--r--ydb/services/ydb/ydb_table_split_ut.cpp8
11 files changed, 70 insertions, 249 deletions
diff --git a/ydb/core/kqp/ut/cost/kqp_cost_ut.cpp b/ydb/core/kqp/ut/cost/kqp_cost_ut.cpp
index 7be32f87aa9..9e484118a66 100644
--- a/ydb/core/kqp/ut/cost/kqp_cost_ut.cpp
+++ b/ydb/core/kqp/ut/cost/kqp_cost_ut.cpp
@@ -11,10 +11,9 @@ namespace NKqp {
using namespace NYdb;
using namespace NYdb::NTable;
-static NKikimrConfig::TAppConfig GetAppConfig(bool sourceRead, bool streamLookup = true) {
+static NKikimrConfig::TAppConfig GetAppConfig(bool scanSourceRead = false, bool streamLookup = true) {
auto app = NKikimrConfig::TAppConfig();
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(sourceRead);
- app.MutableTableServiceConfig()->SetEnableKqpScanQuerySourceRead(sourceRead);
+ app.MutableTableServiceConfig()->SetEnableKqpScanQuerySourceRead(scanSourceRead);
app.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(streamLookup);
return app;
}
@@ -43,8 +42,9 @@ Y_UNIT_TEST_SUITE(KqpCost) {
//runtime->SetLogPriority(NKikimrServices::BLOB_CACHE, NActors::NLog::PRI_DEBUG);
//runtime->SetLogPriority(NKikimrServices::GRPC_SERVER, NActors::NLog::PRI_DEBUG);
}
- Y_UNIT_TEST_TWIN(PointLookup, SourceRead) {
- TKikimrRunner kikimr(GetAppConfig(SourceRead, false));
+
+ Y_UNIT_TEST(PointLookup) {
+ TKikimrRunner kikimr(GetAppConfig(false, false));
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -70,8 +70,8 @@ Y_UNIT_TEST_SUITE(KqpCost) {
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).reads().bytes(), 20);
}
- Y_UNIT_TEST_TWIN(Range, SourceRead) {
- TKikimrRunner kikimr(GetAppConfig(SourceRead));
+ Y_UNIT_TEST(Range) {
+ TKikimrRunner kikimr(GetAppConfig());
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -97,8 +97,8 @@ Y_UNIT_TEST_SUITE(KqpCost) {
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(phase).table_access(0).reads().bytes(), 40);
}
- Y_UNIT_TEST_TWIN(RangeFullScan, SourceRead) {
- TKikimrRunner kikimr(GetAppConfig(SourceRead));
+ Y_UNIT_TEST(RangeFullScan) {
+ TKikimrRunner kikimr(GetAppConfig());
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -172,8 +172,8 @@ Y_UNIT_TEST_SUITE(KqpCost) {
CompareYson(Expected, res.ResultSetYson);
}
- Y_UNIT_TEST_TWIN(QuerySeviceRangeFullScan, SourceRead) {
- TKikimrRunner kikimr(GetAppConfig(SourceRead));
+ Y_UNIT_TEST(QuerySeviceRangeFullScan) {
+ TKikimrRunner kikimr(GetAppConfig());
NYdb::NQuery::TQueryClient client(kikimr.GetDriver());
auto query = Q_(Query);
diff --git a/ydb/core/kqp/ut/effects/kqp_inplace_update_ut.cpp b/ydb/core/kqp/ut/effects/kqp_inplace_update_ut.cpp
index b8912474b5b..87488940d18 100644
--- a/ydb/core/kqp/ut/effects/kqp_inplace_update_ut.cpp
+++ b/ydb/core/kqp/ut/effects/kqp_inplace_update_ut.cpp
@@ -57,7 +57,6 @@ void PreparePgTable(TSession& session) {
}
void Test(
- bool enableInplaceUpdate,
const TString& query,
TParams&& params,
const TString& expectedResult,
@@ -70,7 +69,6 @@ void Test(
// source read and stream lookup use iterator interface, that doesn't use datashard transactions
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);
auto settings = TKikimrSettings()
@@ -89,7 +87,7 @@ void Test(
auto q = TStringBuilder()
<< R"(
--!syntax_v1
- PRAGMA kikimr.OptEnableInplaceUpdate = ')" << (enableInplaceUpdate ? "true" : "false") << "';" << Endl
+ PRAGMA kikimr.OptEnableInplaceUpdate = ')" << "true" << "';" << Endl
<< query;
auto result = session.ExecuteDataQuery(q, TTxControl::BeginTx().CommitTx(), params, execSettings).ExtractValueSync();
@@ -116,9 +114,8 @@ void Test(
UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases(phaseNo).table_access(0).partitions_count(), std::max(readsCnt, updatesCnt), stats.DebugString());
-Y_UNIT_TEST_TWIN(SingleRowSimple, EnableInplaceUpdate) {
+Y_UNIT_TEST(SingleRowSimple) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint64;
DECLARE $value AS String;
@@ -135,20 +132,14 @@ Y_UNIT_TEST_TWIN(SingleRowSimple, EnableInplaceUpdate) {
[[20u];["Two"];[200u];[202.]]
])",
[](const Ydb::TableStats::QueryStats& stats) {
- if constexpr (EnableInplaceUpdate) {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 1, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 1);
- } else {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
- ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
- }
+ UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
+ ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
+ ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
});
}
-Y_UNIT_TEST_TWIN(SingleRowStr, EnableInplaceUpdate) {
+Y_UNIT_TEST(SingleRowStr) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint64;
DECLARE $value AS String;
@@ -165,20 +156,14 @@ Y_UNIT_TEST_TWIN(SingleRowStr, EnableInplaceUpdate) {
[[20u];["Two"];[200u];[202.]]
])",
[](const Ydb::TableStats::QueryStats& stats) {
- if constexpr (EnableInplaceUpdate) {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 1, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 1);
- } else {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
- ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
- }
+ UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
+ ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
+ ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
});
}
-Y_UNIT_TEST_TWIN(SingleRowArithm, EnableInplaceUpdate) {
+Y_UNIT_TEST(SingleRowArithm) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint64;
DECLARE $x AS Uint64;
DECLARE $y AS Double;
@@ -198,20 +183,14 @@ Y_UNIT_TEST_TWIN(SingleRowArithm, EnableInplaceUpdate) {
[[20u];["Two"];[200u];[202.]]
])",
[](const Ydb::TableStats::QueryStats& stats) {
- if constexpr (EnableInplaceUpdate) {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 1, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 1);
- } else {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
- ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
- }
+ UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
+ ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
+ ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
});
}
-Y_UNIT_TEST_TWIN(SingleRowIf, EnableInplaceUpdate) {
+Y_UNIT_TEST(SingleRowIf) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint64;
$trim = ($v, $min, $max) -> {
@@ -235,21 +214,15 @@ Y_UNIT_TEST_TWIN(SingleRowIf, EnableInplaceUpdate) {
[[20u];["Two"];[200u];[202.]]
])",
[](const Ydb::TableStats::QueryStats& stats) {
- if constexpr (EnableInplaceUpdate) {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 1, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 1);
- } else {
- UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
- ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
- ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
- }
+ UNIT_ASSERT_VALUES_EQUAL_C(stats.query_phases().size(), 2, stats.DebugString());
+ ASSERT_PHASE(stats, 0, "/Root/InplaceUpdate", 1, 0);
+ ASSERT_PHASE(stats, 1, "/Root/InplaceUpdate", 0, 1);
});
}
// allow multiple keys in KqpLookupTable to enable this test
-Y_UNIT_TEST_TWIN(Negative_SingleRowWithKeyCast, EnableInplaceUpdate) {
+Y_UNIT_TEST(Negative_SingleRowWithKeyCast) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint32; -- not Uint64
DECLARE $value AS String;
@@ -279,7 +252,7 @@ Y_UNIT_TEST_TWIN(Negative_SingleRowWithKeyCast, EnableInplaceUpdate) {
});
}
-Y_UNIT_TEST_TWIN(Negative_SingleRowWithValueCast, EnableInplaceUpdate) {
+Y_UNIT_TEST(Negative_SingleRowWithValueCast) {
/*
(
(declare $key (DataType 'Uint64))
@@ -293,7 +266,6 @@ Y_UNIT_TEST_TWIN(Negative_SingleRowWithValueCast, EnableInplaceUpdate) {
`Convert` is not safe callable, so there is no InplaceUpdate optimization here
*/
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint64;
DECLARE $value AS Int32; -- not Uint64
@@ -316,9 +288,8 @@ Y_UNIT_TEST_TWIN(Negative_SingleRowWithValueCast, EnableInplaceUpdate) {
});
}
-Y_UNIT_TEST_TWIN(Negative_SingleRowListFromRange, EnableInplaceUpdate) {
+Y_UNIT_TEST(Negative_SingleRowListFromRange) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key AS Uint64;
$foo = ($x) -> {
@@ -345,9 +316,8 @@ Y_UNIT_TEST_TWIN(Negative_SingleRowListFromRange, EnableInplaceUpdate) {
}
// allow multiple keys in KqpLookupTable to enable this test
-Y_UNIT_TEST_TWIN(Negative_BatchUpdate, EnableInplaceUpdate) {
+Y_UNIT_TEST(Negative_BatchUpdate) {
Test(
- EnableInplaceUpdate,
R"( DECLARE $key1 AS Uint64;
DECLARE $value1 AS String;
DECLARE $key2 AS Uint64;
@@ -389,7 +359,7 @@ Y_UNIT_TEST_TWIN(Negative_BatchUpdate, EnableInplaceUpdate) {
});
}
-Y_UNIT_TEST_TWIN(BigRow, EnableInplaceUpdate) {
+Y_UNIT_TEST(BigRow) {
auto keysLimitSetting = NKikimrKqp::TKqpSetting();
keysLimitSetting.SetName("_CommitPerShardKeysSizeLimitBytes");
keysLimitSetting.SetValue("100");
@@ -400,7 +370,6 @@ Y_UNIT_TEST_TWIN(BigRow, EnableInplaceUpdate) {
// source read use iterator interface, that doesn't use datashard transactions
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);
auto settings = TKikimrSettings()
@@ -435,40 +404,27 @@ Y_UNIT_TEST_TWIN(BigRow, EnableInplaceUpdate) {
UPDATE `/Root/Temp` SET
Value2 = Value1
WHERE Key = $Key
- )", EnableInplaceUpdate ? "true" : "false");
+ )", "true");
auto params = db.GetParamsBuilder()
.AddParam("$Key").Uint32(1).Build()
.Build();
result = session.ExecuteDataQuery(query, TTxControl::BeginTx().CommitTx(), params).ExtractValueSync();
-
- if constexpr (EnableInplaceUpdate) {
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::BAD_REQUEST);
- UNIT_ASSERT(HasIssue(result.GetIssues(), NYql::TIssuesIds::DEFAULT_ERROR, [](const NYql::TIssue& issue) {
- return issue.GetMessage().Contains("READ_SIZE_EXECEEDED");
- }));
- } else {
- UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
- }
+ UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
result = session.ExecuteDataQuery(R"(
SELECT Value2 FROM `/Root/Temp` ORDER BY Value2;
)", TTxControl::BeginTx().CommitTx()).ExtractValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::SUCCESS, result.GetIssues().ToString());
- if constexpr (EnableInplaceUpdate) {
- CompareYson(R"([[#];[#]])", FormatResultSetYson(result.GetResultSet(0)));
- } else {
- CompareYson(R"([
- [#];[["123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"]]
- ])", FormatResultSetYson(result.GetResultSet(0)));
- }
+ CompareYson(R"([
+ [#];[["123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"]]
+ ])", FormatResultSetYson(result.GetResultSet(0)));
}
Y_UNIT_TEST(SingleRowPgNotNull) {
Test(
- true,
R"( DECLARE $key AS Uint64;
DECLARE $value AS PgInt2;
diff --git a/ydb/core/kqp/ut/indexes/kqp_indexes_multishard_ut.cpp b/ydb/core/kqp/ut/indexes/kqp_indexes_multishard_ut.cpp
index bc08cedecb1..d4c7cb2b97c 100644
--- a/ydb/core/kqp/ut/indexes/kqp_indexes_multishard_ut.cpp
+++ b/ydb/core/kqp/ut/indexes/kqp_indexes_multishard_ut.cpp
@@ -1643,7 +1643,6 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
Y_UNIT_TEST_TWIN(DataColumnUpsertMixedSemantic, StreamLookup) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
@@ -1692,7 +1691,6 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
Y_UNIT_TEST_TWIN(DataColumnWriteNull, StreamLookup) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
@@ -1775,7 +1773,6 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
Y_UNIT_TEST_TWIN(DataColumnWrite, StreamLookup) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
@@ -2176,7 +2173,6 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
Y_UNIT_TEST_TWIN(DataColumnSelect, StreamLookup) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
@@ -2274,7 +2270,6 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
Y_UNIT_TEST_TWIN(DuplicateUpsert, StreamLookup) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
@@ -2311,7 +2306,6 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
Y_UNIT_TEST_TWIN(SortByPk, StreamLookup) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig);
@@ -2533,10 +2527,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
CheckWriteIntoRenamingIndex(true);
}
- Y_UNIT_TEST_TWIN(CheckPushTopSort, StreamLookup) {
+ Y_UNIT_TEST(CheckPushTopSort) {
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(StreamLookup);
-
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig);
diff --git a/ydb/core/kqp/ut/opt/kqp_ne_ut.cpp b/ydb/core/kqp/ut/opt/kqp_ne_ut.cpp
index 2dcce5cd1e2..a369f4caba4 100644
--- a/ydb/core/kqp/ut/opt/kqp_ne_ut.cpp
+++ b/ydb/core/kqp/ut/opt/kqp_ne_ut.cpp
@@ -31,7 +31,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(ContainerRegistryCombiner) {
TKikimrSettings settings = TKikimrSettings().SetWithSampleTables(false);
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
appConfig.MutableTableServiceConfig()->SetEnableKqpScanQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
@@ -141,13 +140,7 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
auto explainResult = session.ExplainDataQuery(query).GetValueSync();
UNIT_ASSERT_VALUES_EQUAL_C(explainResult.GetStatus(), EStatus::SUCCESS, explainResult.GetIssues().ToString());
-
- if (settings.AppConfig.GetTableServiceConfig().GetEnableKqpDataQuerySourceRead()) {
- UNIT_ASSERT_C(explainResult.GetAst().Contains("KqpReadRangesSource"), explainResult.GetAst());
- } else {
- UNIT_ASSERT_C(explainResult.GetAst().Contains("KqpLookupTable"), explainResult.GetAst());
- UNIT_ASSERT_C(!explainResult.GetAst().Contains("Take"), explainResult.GetAst());
- }
+ UNIT_ASSERT_C(explainResult.GetAst().Contains("KqpReadRangesSource"), explainResult.GetAst());
auto params = kikimr.GetTableClient().GetParamsBuilder()
.AddParam("$key").Uint64(302).Build()
@@ -3273,9 +3266,8 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
CompareYson(R"([[["Value1"]]])", FormatResultSetYson(result.GetResultSet(0)));
}
- Y_UNIT_TEST_TWIN(PagingNoPredicateExtract, SourceRead) {
+ Y_UNIT_TEST(PagingNoPredicateExtract) {
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(SourceRead);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig);
@@ -3319,10 +3311,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
// Cerr << result.GetPlan() << Endl;
- if (SourceRead) {
- return;
- }
-
NJson::TJsonValue plan;
NJson::ReadJsonTree(result.GetPlan(), &plan, true);
auto reads = plan["tables"][0]["reads"].GetArraySafe();
@@ -3662,7 +3650,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSourceCount) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
@@ -3691,7 +3678,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSource) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
@@ -3711,7 +3697,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSourceLiteralRange) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
@@ -3742,7 +3727,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSourceLimit) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
@@ -3769,7 +3753,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSourceSequentialLimit) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetAppConfig(appConfig);
TKikimrRunner kikimr(settings);
@@ -3804,7 +3787,6 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
Y_UNIT_TEST(DqSourceLocksEffects) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(true);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
@@ -4068,7 +4050,7 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
SELECT Key FROM `/Root/EightShard` where Key in $items;
)";
- auto params1 = TParamsBuilder()
+ auto params1 = TParamsBuilder()
.AddParam("$items")
.BeginList()
.AddListItem().Uint64(0)
@@ -4082,7 +4064,7 @@ Y_UNIT_TEST_SUITE(KqpNewEngine) {
AssertSuccessResult(result);
UNIT_ASSERT_EQUAL(counters.FullScansExecuted->GetAtomic(), before);
- auto params2 = TParamsBuilder()
+ auto params2 = TParamsBuilder()
.AddParam("$items")
.BeginList()
.AddListItem().Uint64(0)
diff --git a/ydb/core/kqp/ut/opt/kqp_sort_ut.cpp b/ydb/core/kqp/ut/opt/kqp_sort_ut.cpp
index df342c525fc..4ffed8ba240 100644
--- a/ydb/core/kqp/ut/opt/kqp_sort_ut.cpp
+++ b/ydb/core/kqp/ut/opt/kqp_sort_ut.cpp
@@ -1127,9 +1127,8 @@ Y_UNIT_TEST_SUITE(KqpSort) {
])", FormatResultSetYson(result.GetResultSet(2)));
}
- Y_UNIT_TEST_TWIN(UnionAllSortLimit, SourceRead) {
+ Y_UNIT_TEST(UnionAllSortLimit) {
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(SourceRead);
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig);
@@ -1152,10 +1151,6 @@ Y_UNIT_TEST_SUITE(KqpSort) {
NJson::TJsonValue plan;
NJson::ReadJsonTree(result.GetPlan(), &plan, true);
- if (SourceRead) {
- return;
- }
-
for (auto& read : plan["tables"][0]["reads"].GetArraySafe()) {
UNIT_ASSERT(read.Has("limit"));
UNIT_ASSERT_VALUES_EQUAL(read["limit"], "3");
diff --git a/ydb/core/kqp/ut/query/kqp_explain_ut.cpp b/ydb/core/kqp/ut/query/kqp_explain_ut.cpp
index 4528ab213e6..0039dcc4048 100644
--- a/ydb/core/kqp/ut/query/kqp_explain_ut.cpp
+++ b/ydb/core/kqp/ut/query/kqp_explain_ut.cpp
@@ -849,10 +849,9 @@ Y_UNIT_TEST_SUITE(KqpExplain) {
}
}
- Y_UNIT_TEST_TWIN(IdxFullscan, Source) {
+ Y_UNIT_TEST(IdxFullscan) {
TKikimrSettings settings;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(Source);
settings.SetDomainRoot(KikimrDefaultUtDomainRoot);
settings.SetAppConfig(appConfig);
diff --git a/ydb/core/kqp/ut/query/kqp_limits_ut.cpp b/ydb/core/kqp/ut/query/kqp_limits_ut.cpp
index a5c993eff08..5911fba313d 100644
--- a/ydb/core/kqp/ut/query/kqp_limits_ut.cpp
+++ b/ydb/core/kqp/ut/query/kqp_limits_ut.cpp
@@ -174,7 +174,6 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
Y_UNIT_TEST(DatashardReplySize) {
auto app = NKikimrConfig::TAppConfig();
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
auto& queryLimits = *app.MutableTableServiceConfig()->MutableQueryLimits();
queryLimits.MutablePhaseLimits()->SetComputeNodeMemoryLimitBytes(1'000'000'000);
@@ -190,7 +189,7 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
SELECT * FROM `/Root/LargeTable`;
)"), TTxControl::BeginTx().CommitTx()).ExtractValueSync();
result.GetIssues().PrintTo(Cerr);
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::UNDETERMINED);
+ UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::PRECONDITION_FAILED);
UNIT_ASSERT(HasIssue(result.GetIssues(), NYql::TIssuesIds::KIKIMR_RESULT_UNAVAILABLE));
}
@@ -840,8 +839,6 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
Y_UNIT_TEST(DataShardReplySizeExceeded) {
auto app = NKikimrConfig::TAppConfig();
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
-
TKikimrRunner kikimr(app);
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -929,10 +926,9 @@ Y_UNIT_TEST_SUITE(KqpLimits) {
auto result = session.ExecuteDataQuery(Q_(R"(
SELECT * FROM `/Root/TableTest`;
)"), TTxControl::BeginTx().CommitTx()).ExtractValueSync();
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::UNDETERMINED);
- UNIT_ASSERT_C(result.GetIssues().ToString().Contains("REPLY_SIZE_EXCEEDED"), result.GetIssues().ToString());
- UNIT_ASSERT_VALUES_EQUAL(counters.GetTxReplySizeExceededError()->Val(), 0);
- UNIT_ASSERT_VALUES_EQUAL(counters.GetDataShardTxReplySizeExceededError()->Val(), 1);
+ UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus(), EStatus::PRECONDITION_FAILED, result.GetIssues().ToString());
+ UNIT_ASSERT_C(result.GetIssues().ToString().Contains("result size limit"), result.GetIssues().ToString());
+ UNIT_ASSERT_VALUES_EQUAL(counters.GetTxReplySizeExceededError()->Val(), 1);
}
}
diff --git a/ydb/core/kqp/ut/query/kqp_query_ut.cpp b/ydb/core/kqp/ut/query/kqp_query_ut.cpp
index f5e23a9f1ce..f288352fb1c 100644
--- a/ydb/core/kqp/ut/query/kqp_query_ut.cpp
+++ b/ydb/core/kqp/ut/query/kqp_query_ut.cpp
@@ -309,7 +309,6 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
Y_UNIT_TEST(QueryTimeout) {
NKikimrConfig::TAppConfig app;
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
TKikimrRunner kikimr(TKikimrSettings().SetAppConfig(app));
auto db = kikimr.GetTableClient();
@@ -321,7 +320,10 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
auto txControl = TTxControl::BeginTx().CommitTx();
- NDataShard::gSkipRepliesFailPoint.Enable(-1, -1, 1);
+ NDataShard::gSkipReadIteratorResultFailPoint.Enable(-1);
+ Y_DEFER {
+ NDataShard::gSkipReadIteratorResultFailPoint.Disable();
+ };
auto result = session.ExecuteDataQuery(
query,
@@ -333,7 +335,7 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
result.GetIssues().PrintTo(Cerr);
UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::TIMEOUT);
- NDataShard::gSkipRepliesFailPoint.Disable();
+ NDataShard::gSkipReadIteratorResultFailPoint.Disable();
const TInstant start = TInstant::Now();
// Check session is ready or busy, but eventualy must be ready
@@ -349,44 +351,8 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
}
}
- Y_UNIT_TEST(QueryTimeoutImmediate) {
- NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);
- auto settings = TKikimrSettings()
- .SetAppConfig(appConfig);
- TKikimrRunner kikimr{settings};
- auto db = kikimr.GetTableClient();
- auto session = db.CreateSession().GetValueSync().GetSession();
-
- auto query = Q_(R"(
- SELECT * FROM `/Root/TwoShard` WHERE Key == 1;
- )");
-
- auto txControl = TTxControl::BeginTx().CommitTx();
-
- NDataShard::gSkipRepliesFailPoint.Enable(-1, -1, 1);
-
- auto result = session.ExecuteDataQuery(
- query,
- txControl,
- TExecDataQuerySettings()
- .OperationTimeout(TDuration::MilliSeconds(50))
- ).ExtractValueSync();
-
- result.GetIssues().PrintTo(Cerr);
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::TIMEOUT);
-
- NDataShard::gSkipRepliesFailPoint.Disable();
-
- // Check session is ready or busy (both possible)
- result = session.ExecuteDataQuery(query, txControl).ExtractValueSync();
- UNIT_ASSERT_VALUES_EQUAL_C(result.GetStatus() == EStatus::SUCCESS || result.GetStatus() == EStatus::SESSION_BUSY, true, result.GetIssues().ToString());
- }
-
Y_UNIT_TEST(QueryClientTimeout) {
NKikimrConfig::TAppConfig app;
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
auto serverSettings = TKikimrSettings()
.SetAppConfig(app);
@@ -403,7 +369,10 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
auto txControl = TTxControl::BeginTx().CommitTx();
- NDataShard::gSkipRepliesFailPoint.Enable(-1, -1, 2);
+ NDataShard::gSkipReadIteratorResultFailPoint.Enable(-1);
+ Y_DEFER {
+ NDataShard::gSkipReadIteratorResultFailPoint.Disable();
+ };
auto result = session.ExecuteDataQuery(
query,
@@ -416,14 +385,13 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
result.GetIssues().PrintTo(Cerr);
UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::CLIENT_DEADLINE_EXCEEDED);
- NDataShard::gSkipRepliesFailPoint.Disable();
+ NDataShard::gSkipReadIteratorResultFailPoint.Disable();
CheckStatusAfterTimeout(session, query, txControl);
}
Y_UNIT_TEST(QueryClientTimeoutPrecompiled) {
NKikimrConfig::TAppConfig app;
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
TKikimrRunner kikimr(TKikimrSettings().SetAppConfig(app));
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();
@@ -442,7 +410,10 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
auto txControl = TTxControl::BeginTx().CommitTx();
- NDataShard::gSkipRepliesFailPoint.Enable(-1, -1, 1);
+ NDataShard::gSkipReadIteratorResultFailPoint.Enable(-1);
+ Y_DEFER {
+ NDataShard::gSkipReadIteratorResultFailPoint.Disable();
+ };
auto result = prepareResult.GetQuery().Execute(
txControl,
@@ -454,74 +425,11 @@ Y_UNIT_TEST_SUITE(KqpQuery) {
result.GetIssues().PrintTo(Cerr);
UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::CLIENT_DEADLINE_EXCEEDED);
- NDataShard::gSkipRepliesFailPoint.Disable();
+ NDataShard::gSkipReadIteratorResultFailPoint.Disable();
CheckStatusAfterTimeout(session, query, txControl);
}
- Y_UNIT_TEST(QueryCancel) {
- NKikimrConfig::TAppConfig app;
- app.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
- TKikimrRunner kikimr(TKikimrSettings().SetAppConfig(app));
- auto db = kikimr.GetTableClient();
- auto session = db.CreateSession().GetValueSync().GetSession();
-
- auto query = Q_(R"(
- SELECT * FROM `/Root/TwoShard`
- )");
-
- auto txControl = TTxControl::BeginTx().CommitTx();
-
- NDataShard::gCancelTxFailPoint.Enable(-1, -1, 1);
-
- auto result = session.ExecuteDataQuery(
- query,
- txControl
- ).ExtractValueSync();
-
- result.GetIssues().PrintTo(Cerr);
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::CANCELLED);
-
- NDataShard::gCancelTxFailPoint.Disable();
-
- // Check session is ready
- result = session.ExecuteDataQuery(query, txControl).ExtractValueSync();
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::SUCCESS);
- }
-
- Y_UNIT_TEST(QueryCancelImmediate) {
- NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
- auto settings = TKikimrSettings()
- .SetAppConfig(appConfig);
- TKikimrRunner kikimr{settings};
- auto db = kikimr.GetTableClient();
- auto session = db.CreateSession().GetValueSync().GetSession();
-
- auto query = Q_(R"(
- SELECT * FROM `/Root/TwoShard` WHERE Key == 1;
- )");
-
- auto txControl = TTxControl::BeginTx().CommitTx();
-
- NDataShard::gCancelTxFailPoint.Enable(-1, -1, 0);
-
- auto result = session.ExecuteDataQuery(
- query,
- txControl
- ).ExtractValueSync();
-
- result.GetIssues().PrintTo(Cerr);
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::CANCELLED);
-
- NDataShard::gCancelTxFailPoint.Disable();
-
- // Check session is ready
- result = session.ExecuteDataQuery(query, txControl).ExtractValueSync();
- UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::SUCCESS);
- }
-
Y_UNIT_TEST(QueryCancelWrite) {
TKikimrRunner kikimr;
auto db = kikimr.GetTableClient();
diff --git a/ydb/core/sys_view/ut_common.cpp b/ydb/core/sys_view/ut_common.cpp
index 868d1912b0f..3583b14700d 100644
--- a/ydb/core/sys_view/ut_common.cpp
+++ b/ydb/core/sys_view/ut_common.cpp
@@ -26,7 +26,7 @@ NKikimrSubDomains::TSubDomainSettings GetSubDomainDefaultSettings(const TString
return subdomain;
}
-TTestEnv::TTestEnv(ui32 staticNodes, ui32 dynamicNodes, ui32 storagePools, ui32 pqTabletsN, bool enableSVP, bool disableSources) {
+TTestEnv::TTestEnv(ui32 staticNodes, ui32 dynamicNodes, ui32 storagePools, ui32 pqTabletsN, bool enableSVP) {
auto mbusPort = PortManager.GetPort();
auto grpcPort = PortManager.GetPort();
@@ -53,7 +53,6 @@ TTestEnv::TTestEnv(ui32 staticNodes, ui32 dynamicNodes, ui32 storagePools, ui32
Settings->AddStoragePool(poolName, TString("/Root:") + poolName, 2);
}
- Settings->AppConfig->MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(!disableSources);
Settings->AppConfig->MutableHiveConfig()->AddBalancerIgnoreTabletTypes(NKikimrTabletBase::TTabletTypes::SysViewProcessor);
Server = new Tests::TServer(*Settings);
diff --git a/ydb/core/sys_view/ut_common.h b/ydb/core/sys_view/ut_common.h
index c921d32c209..1ae840655ac 100644
--- a/ydb/core/sys_view/ut_common.h
+++ b/ydb/core/sys_view/ut_common.h
@@ -23,13 +23,7 @@ public:
public:
TTestEnv(ui32 staticNodes = 1, ui32 dynamicNodes = 4, ui32 storagePools = 0,
- ui32 pqTabletsN = 0, bool enableSVP = false, bool disableSources = false);
-
- template<typename... Args>
- TTestEnv(TDisableSourcesTag, Args&&... args)
- : TTestEnv(std::forward<Args>(args)..., false)
- {
- }
+ ui32 pqTabletsN = 0, bool enableSVP = false);
~TTestEnv();
diff --git a/ydb/services/ydb/ydb_table_split_ut.cpp b/ydb/services/ydb/ydb_table_split_ut.cpp
index 5a498fc2895..1d8131229ab 100644
--- a/ydb/services/ydb/ydb_table_split_ut.cpp
+++ b/ydb/services/ydb/ydb_table_split_ut.cpp
@@ -368,7 +368,6 @@ Y_UNIT_TEST_SUITE(YdbTableSplit) {
NKikimr::TAppData::TimeProvider = testTimeProvider;
NKikimrConfig::TAppConfig appConfig;
- appConfig.MutableTableServiceConfig()->SetEnableKqpDataQuerySourceRead(false);
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);
TKikimrWithGrpcAndRootSchema server(appConfig);
@@ -404,15 +403,16 @@ Y_UNIT_TEST_SUITE(YdbTableSplit) {
UNIT_ASSERT_VALUES_UNEQUAL(shardsBefore, 1);
// Fast forward time a bit multiple time and check that merge doesn't happen
- for (int i = 0; i < 8; ++i) {
+ /*
+ for (int i = 0; i < 7; ++i) {
Cerr << "Fast forward 1h" << Endl;
testTimeProvider->AddShift(TDuration::Hours(1));
Sleep(TDuration::Seconds(3));
UNIT_ASSERT_VALUES_EQUAL(oldClient.GetTablePartitions("/Root/Foo").size(), shardsBefore);
- }
+ }*/
Cerr << "Fast forward > 10h to trigger the merge" << Endl;
- testTimeProvider->AddShift(TDuration::Hours(8));
+ testTimeProvider->AddShift(TDuration::Hours(16));
// Wait for merge to happen
size_t shardsAfter = shardsBefore;