Skip to content

remove some portion of stream lookup tests (#15202) #15283

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

Merged
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
34 changes: 12 additions & 22 deletions ydb/core/kqp/ut/cost/kqp_cost_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ namespace NKqp {
using namespace NYdb;
using namespace NYdb::NTable;

static NKikimrConfig::TAppConfig GetAppConfig(bool scanSourceRead = false, bool streamLookup = true, bool streamLookupJoin = false, bool enableOltpSink = false) {
static NKikimrConfig::TAppConfig GetAppConfig(bool scanSourceRead = false, bool streamLookupJoin = false, bool enableOltpSink = false) {
auto app = NKikimrConfig::TAppConfig();
app.MutableTableServiceConfig()->SetEnableKqpScanQuerySourceRead(scanSourceRead);
app.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(streamLookup);
app.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamIdxLookupJoin(streamLookupJoin);
app.MutableTableServiceConfig()->SetEnableOlapSink(true);
app.MutableTableServiceConfig()->SetEnableOltpSink(enableOltpSink);
Expand Down Expand Up @@ -110,11 +109,8 @@ Y_UNIT_TEST_SUITE(KqpCost) {
//runtime->SetLogPriority(NKikimrServices::GRPC_SERVER, NActors::NLog::PRI_DEBUG);
}

Y_UNIT_TEST_QUAD(IndexLookup, StreamLookup, useSink) {
if (useSink && !StreamLookup) {
return;
}
TKikimrRunner kikimr(GetAppConfig(true, StreamLookup, false, useSink));
Y_UNIT_TEST_TWIN(IndexLookup, useSink) {
TKikimrRunner kikimr(GetAppConfig(true, false, useSink));
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -178,11 +174,8 @@ Y_UNIT_TEST_SUITE(KqpCost) {
UNIT_ASSERT_VALUES_EQUAL(readsByTable.at("/Root/SecondaryKeys/Index/indexImplTable").second, 8);
}

Y_UNIT_TEST_QUAD(IndexLookupAtLeast8BytesInStorage, StreamLookup, useSink) {
if (useSink && !StreamLookup) {
return;
}
TKikimrRunner kikimr(GetAppConfig(true, StreamLookup, false, useSink));
Y_UNIT_TEST_TWIN(IndexLookupAtLeast8BytesInStorage, useSink) {
TKikimrRunner kikimr(GetAppConfig(true, false, useSink));
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -247,11 +240,8 @@ Y_UNIT_TEST_SUITE(KqpCost) {
UNIT_ASSERT_VALUES_EQUAL(readsByTable.at("/Root/SecondaryKeys/Index/indexImplTable").second, 8);
}

Y_UNIT_TEST_QUAD(IndexLookupAndTake, StreamLookup, useSink) {
if (useSink && !StreamLookup) {
return;
}
TKikimrRunner kikimr(GetAppConfig(true, StreamLookup, false, useSink));
Y_UNIT_TEST_TWIN(IndexLookupAndTake, useSink) {
TKikimrRunner kikimr(GetAppConfig(true, false, useSink));
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -370,7 +360,7 @@ Y_UNIT_TEST_SUITE(KqpCost) {
}

Y_UNIT_TEST_TWIN(IndexLookupJoin, StreamLookupJoin) {
TKikimrRunner kikimr(GetAppConfig(true, true, StreamLookupJoin, false));
TKikimrRunner kikimr(GetAppConfig(true, StreamLookupJoin, false));
auto db = kikimr.GetTableClient();
auto session = db.CreateSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -532,7 +522,7 @@ Y_UNIT_TEST_SUITE(KqpCost) {
}

Y_UNIT_TEST(OlapPointLookup) {
TKikimrRunner kikimr(GetAppConfig(false, false));
TKikimrRunner kikimr(GetAppConfig(false));
auto db = kikimr.GetQueryClient();
auto session = db.GetSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -622,7 +612,7 @@ Y_UNIT_TEST_SUITE(KqpCost) {
}

Y_UNIT_TEST(OlapWriteRow) {
TKikimrRunner kikimr(GetAppConfig(false, false, false, true));
TKikimrRunner kikimr(GetAppConfig(false, false, true));
auto db = kikimr.GetQueryClient();
auto session = db.GetSession().GetValueSync().GetSession();

Expand Down Expand Up @@ -676,7 +666,7 @@ Y_UNIT_TEST_SUITE(KqpCost) {
auto result = session.ExecuteQuery(query, txControl, GetQuerySettings()).ExtractValueSync();
// TODO: fix status?
UNIT_ASSERT_VALUES_EQUAL(result.GetStatus(), EStatus::BAD_REQUEST);

auto stats = NYdb::TProtoAccessor::GetProto(*result.GetStats());

Cerr << stats.DebugString() << Endl;
Expand Down Expand Up @@ -789,7 +779,7 @@ Y_UNIT_TEST_SUITE(KqpCost) {
}

Y_UNIT_TEST_TWIN(OltpWriteRow, isSink) {
TKikimrRunner kikimr(GetAppConfig(false, false, false, isSink));
TKikimrRunner kikimr(GetAppConfig(false, false, isSink));
auto db = kikimr.GetQueryClient();
auto session = db.GetSession().GetValueSync().GetSession();

Expand Down
2 changes: 0 additions & 2 deletions ydb/core/kqp/ut/effects/kqp_inplace_update_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ void Test(

// source read and stream lookup use iterator interface, that doesn't use datashard transactions
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);

auto settings = TKikimrSettings()
.SetAppConfig(appConfig)
Expand Down Expand Up @@ -370,7 +369,6 @@ Y_UNIT_TEST(BigRow) {

// source read use iterator interface, that doesn't use datashard transactions
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(false);

auto settings = TKikimrSettings()
.SetAppConfig(appConfig)
Expand Down
21 changes: 6 additions & 15 deletions ydb/core/kqp/ut/indexes/kqp_indexes_multishard_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1641,10 +1641,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
}
}

Y_UNIT_TEST_TWIN(DataColumnUpsertMixedSemantic, StreamLookup) {
Y_UNIT_TEST(DataColumnUpsertMixedSemantic) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);

auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
Expand Down Expand Up @@ -1689,10 +1687,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
}
}

Y_UNIT_TEST_TWIN(DataColumnWriteNull, StreamLookup) {
Y_UNIT_TEST(DataColumnWriteNull) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);

auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig)
Expand Down Expand Up @@ -1771,9 +1767,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
}
}

Y_UNIT_TEST_TWIN(DataColumnWrite, StreamLookup) {
Y_UNIT_TEST(DataColumnWrite) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);

auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
Expand Down Expand Up @@ -2171,9 +2166,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
}
}

Y_UNIT_TEST_TWIN(DataColumnSelect, StreamLookup) {
Y_UNIT_TEST(DataColumnSelect) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);

auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
Expand Down Expand Up @@ -2268,9 +2262,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
}
}

Y_UNIT_TEST_TWIN(DuplicateUpsert, StreamLookup) {
Y_UNIT_TEST(DuplicateUpsert) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);

auto setting = NKikimrKqp::TKqpSetting();
auto serverSettings = TKikimrSettings()
Expand Down Expand Up @@ -2304,10 +2297,8 @@ Y_UNIT_TEST_SUITE(KqpMultishardIndex) {
}
}

Y_UNIT_TEST_TWIN(SortByPk, StreamLookup) {
Y_UNIT_TEST(SortByPk) {
NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(StreamLookup);

auto serverSettings = TKikimrSettings()
.SetAppConfig(appConfig);

Expand Down
76 changes: 16 additions & 60 deletions ydb/core/kqp/ut/indexes/kqp_indexes_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2796,24 +2796,11 @@ Y_UNIT_TEST_SUITE(KqpIndexes) {

auto& stats = NYdb::TProtoAccessor::GetProto(*result.GetStats());

if (serverSettings.AppConfig.GetTableServiceConfig().GetEnableKqpDataQueryStreamLookup()) {
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access().size(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).name(), "/Root/TestTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).reads().rows(), 3);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).name(), "/Root/TestTable/ix_cust/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).reads().rows(), 3);
} else {
int indexPhaseId = 0;
int tablePhaseId = 1;

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(tablePhaseId).table_access().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(tablePhaseId).table_access(0).name(), "/Root/TestTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(tablePhaseId).table_access(0).reads().rows(), 3);

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(indexPhaseId).table_access().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(indexPhaseId).table_access(0).name(), "/Root/TestTable/ix_cust/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(indexPhaseId).table_access(0).reads().rows(), 3);
}
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access().size(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).name(), "/Root/TestTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).reads().rows(), 3);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).name(), "/Root/TestTable/ix_cust/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).reads().rows(), 3);
}
}

Expand Down Expand Up @@ -2844,24 +2831,11 @@ Y_UNIT_TEST_SUITE(KqpIndexes) {

auto& stats = NYdb::TProtoAccessor::GetProto(*result.GetStats());

if (serverSettings.AppConfig.GetTableServiceConfig().GetEnableKqpDataQueryStreamLookup()) {
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access().size(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).name(), "/Root/TestTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).reads().rows(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).name(), "/Root/TestTable/ix_cust2/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).reads().rows(), 2);
} else {
int indexPhaseId = 0;
int tablePhaseId = 1;

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(tablePhaseId).table_access().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(tablePhaseId).table_access(0).name(), "/Root/TestTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(tablePhaseId).table_access(0).reads().rows(), 2);

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(indexPhaseId).table_access().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(indexPhaseId).table_access(0).name(), "/Root/TestTable/ix_cust2/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(indexPhaseId).table_access(0).reads().rows(), 2);
}
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access().size(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).name(), "/Root/TestTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).reads().rows(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).name(), "/Root/TestTable/ix_cust2/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).reads().rows(), 2);
}
}

Expand Down Expand Up @@ -4855,7 +4829,6 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda
.SetKqpSettings({setting});

NKikimrConfig::TAppConfig appConfig;
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamLookup(true);
appConfig.MutableTableServiceConfig()->SetEnableKqpDataQueryStreamIdxLookupJoin(true);
// setting channel buffer size so small to make sure that we will be able to transfer at least
// one row in stream lookup.
Expand Down Expand Up @@ -4998,30 +4971,13 @@ R"([[#;#;["Primary1"];[41u]];[["Secondary2"];[2u];["Primary2"];[42u]];[["Seconda

auto& stats = NYdb::TProtoAccessor::GetProto(*result2.GetStats());

int readPhase = 0;
if (serverSettings.AppConfig.GetTableServiceConfig().GetEnableKqpDataQueryStreamLookup()) {
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases().size(), 1);

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access().size(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(0).name(), "/Root/SecondaryComplexKeys");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(0).reads().rows(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(1).name(), "/Root/SecondaryComplexKeys/Index/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(1).reads().rows(), 1);
} else {
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases().size(), 3);

readPhase++;

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(0).name(), "/Root/SecondaryComplexKeys/Index/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(0).reads().rows(), 1);

readPhase++;
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases().size(), 1);

UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(0).name(), "/Root/SecondaryComplexKeys");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(readPhase).table_access(0).reads().rows(), 1);
}
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access().size(), 2);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).name(), "/Root/SecondaryComplexKeys");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(0).reads().rows(), 1);
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).name(), "/Root/SecondaryComplexKeys/Index/indexImplTable");
UNIT_ASSERT_VALUES_EQUAL(stats.query_phases(0).table_access(1).reads().rows(), 1);
}
}

Expand Down
Loading
Loading