diff options
author | makostrov <makostrov@yandex-team.com> | 2023-08-10 17:48:42 +0300 |
---|---|---|
committer | makostrov <makostrov@yandex-team.com> | 2023-08-10 18:55:46 +0300 |
commit | 1621188680076b9fafdb534e7bdf65b218f1775c (patch) | |
tree | f500eaeee8327481171233c31a432334e420b8ea | |
parent | d4ad75439ad6bd6537256c2b8db68c4ee34f9cdd (diff) | |
download | ydb-1621188680076b9fafdb534e7bdf65b218f1775c.tar.gz |
PR from branch users/makostrov/ydb_result_tx_datashard
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_common.cpp | 1 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_kqp.cpp | 2 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_kqp_stream_lookup.cpp | 13 | ||||
-rw-r--r-- | ydb/core/tx/datashard/datashard_ut_locks.cpp | 9 |
4 files changed, 13 insertions, 12 deletions
diff --git a/ydb/core/tx/datashard/datashard_ut_common.cpp b/ydb/core/tx/datashard/datashard_ut_common.cpp index ce4b15d6d9..688fa4f04f 100644 --- a/ydb/core/tx/datashard/datashard_ut_common.cpp +++ b/ydb/core/tx/datashard/datashard_ut_common.cpp @@ -1054,6 +1054,7 @@ THolder<NKqp::TEvKqp::TEvQueryRequest> MakeSQLRequest(const TString &sql, ? NKikimrKqp::QUERY_TYPE_SQL_DML : NKikimrKqp::QUERY_TYPE_SQL_DDL); request->Record.MutableRequest()->SetQuery(sql); + request->Record.MutableRequest()->SetUsePublicResponseDataFormat(true); return request; } diff --git a/ydb/core/tx/datashard/datashard_ut_kqp.cpp b/ydb/core/tx/datashard/datashard_ut_kqp.cpp index 88583cfe52..c7d940a900 100644 --- a/ydb/core/tx/datashard/datashard_ut_kqp.cpp +++ b/ydb/core/tx/datashard/datashard_ut_kqp.cpp @@ -163,7 +163,7 @@ private: if (!error) { UNIT_ASSERT_EQUAL_C(response.GetYdbStatus(), Ydb::StatusIds::SUCCESS, response.Utf8DebugString()); - UNIT_ASSERT(response.GetResponse().GetResults().empty()); + UNIT_ASSERT(response.GetResponse().GetYdbResults().empty()); writer.OnEndList(); UNIT_ASSERT_STRINGS_EQUAL(ReformatYson(R"( diff --git a/ydb/core/tx/datashard/datashard_ut_kqp_stream_lookup.cpp b/ydb/core/tx/datashard/datashard_ut_kqp_stream_lookup.cpp index d17cf96558..909dd1ccbf 100644 --- a/ydb/core/tx/datashard/datashard_ut_kqp_stream_lookup.cpp +++ b/ydb/core/tx/datashard/datashard_ut_kqp_stream_lookup.cpp @@ -70,9 +70,9 @@ Y_UNIT_TEST_SUITE(KqpStreamLookup) { auto reply = runtime->GrabEdgeEventRethrow<NKqp::TEvKqp::TEvQueryResponse>(sender); UNIT_ASSERT_VALUES_EQUAL(reply->Get()->Record.GetRef().GetYdbStatus(), Ydb::StatusIds::SUCCESS); - auto results = reply->Get()->Record.GetRef().GetResponse().GetResults(); - UNIT_ASSERT_VALUES_EQUAL(results.size(), 1); - UNIT_ASSERT_VALUES_EQUAL(results[0].GetValue().GetStruct(0).ListSize(), 1000); + auto resp = reply->Get()->Record.GetRef().GetResponse(); + UNIT_ASSERT_VALUES_EQUAL(resp.YdbResultsSize(), 1); + UNIT_ASSERT_VALUES_EQUAL(resp.GetYdbResults(0).rows_size(), 1000); } Y_UNIT_TEST(ReadTableWithIndexDuringSplit) { @@ -141,11 +141,10 @@ Y_UNIT_TEST_SUITE(KqpStreamLookup) { auto reply = runtime->GrabEdgeEventRethrow<NKqp::TEvKqp::TEvQueryResponse>(sender); UNIT_ASSERT_VALUES_EQUAL(reply->Get()->Record.GetRef().GetYdbStatus(), Ydb::StatusIds::SUCCESS); - auto results = reply->Get()->Record.GetRef().GetResponse().GetResults(); - UNIT_ASSERT_VALUES_EQUAL(results.size(), 1); - UNIT_ASSERT_VALUES_EQUAL(results[0].GetValue().GetStruct(0).ListSize(), 1); + auto resp = reply->Get()->Record.GetRef().GetResponse(); + UNIT_ASSERT_VALUES_EQUAL(resp.YdbResultsSize(), 1); + UNIT_ASSERT_VALUES_EQUAL(resp.GetYdbResults(0).rows_size(), 1); } } // Y_UNIT_TEST_SUITE(KqpStreamLookup) } // namespace NKikimr - diff --git a/ydb/core/tx/datashard/datashard_ut_locks.cpp b/ydb/core/tx/datashard/datashard_ut_locks.cpp index b334d4400f..d005bc2854 100644 --- a/ydb/core/tx/datashard/datashard_ut_locks.cpp +++ b/ydb/core/tx/datashard/datashard_ut_locks.cpp @@ -705,14 +705,15 @@ void CheckLocksCacheUsage(bool waitForLocksStore) { runtime.Send(new IEventHandle(NKqp::MakeKqpProxyID(runtime.GetNodeId()), sender, request.Release())); auto reply = runtime.GrabEdgeEventRethrow<NKqp::TEvKqp::TEvQueryResponse>(handle); auto &resp = reply->Record.GetRef().GetResponse(); - UNIT_ASSERT_VALUES_EQUAL(resp.ResultsSize(), 1); + UNIT_ASSERT_VALUES_EQUAL(resp.YdbResultsSize(), 1); + if (waitForLocksStore) - UNIT_ASSERT_VALUES_EQUAL(resp.GetResults(0).GetValue().GetStruct(0).ListSize(), 4); + UNIT_ASSERT_VALUES_EQUAL(resp.GetYdbResults(0).rows_size(), 4); else { // We don't actually know whether we killed tablet before locks were stored or after. // So either 2 or 4 records are allowed. - UNIT_ASSERT(resp.GetResults(0).GetValue().GetStruct(0).ListSize() == 4 - || resp.GetResults(0).GetValue().GetStruct(0).ListSize() == 2); + UNIT_ASSERT(resp.GetYdbResults(0).rows_size() == 4 + || resp.GetYdbResults(0).rows_size() == 2); } } } |