diff options
author | galaxycrab <UgnineSirdis@ydb.tech> | 2023-08-09 11:04:56 +0300 |
---|---|---|
committer | galaxycrab <UgnineSirdis@ydb.tech> | 2023-08-09 12:40:45 +0300 |
commit | db046becbe9b9ee859ebc395410df2b251b01990 (patch) | |
tree | a5ed23d4f34b91d9e9acea54034a8c1a7ad4e511 | |
parent | 70c23db3bd53d2227acd663a87b8a1576ed1cb4d (diff) | |
download | ydb-db046becbe9b9ee859ebc395410df2b251b01990.tar.gz |
KIKIMR-18675 Remove truncated from result set meta in Query Service
23 files changed, 268 insertions, 20 deletions
diff --git a/ydb/core/fq/libs/compute/ydb/events/events.h b/ydb/core/fq/libs/compute/ydb/events/events.h index 6888ecca3b..2358de0e3b 100644 --- a/ydb/core/fq/libs/compute/ydb/events/events.h +++ b/ydb/core/fq/libs/compute/ydb/events/events.h @@ -300,19 +300,24 @@ struct TEvYdbCompute { struct TEvResultSetWriterResponse : public NActors::TEventLocal<TEvResultSetWriterResponse, EvResultSetWriterResponse> { - TEvResultSetWriterResponse(NYql::TIssues issues, NYdb::EStatus status) - : Issues(std::move(issues)) + TEvResultSetWriterResponse(ui64 resultSetId, NYql::TIssues issues, NYdb::EStatus status) + : ResultSetId(resultSetId) + , Issues(std::move(issues)) , Status(status) {} - TEvResultSetWriterResponse(int64_t rowsCount) - : Status(NYdb::EStatus::SUCCESS) + TEvResultSetWriterResponse(ui64 resultSetId, int64_t rowsCount, bool truncated) + : ResultSetId(resultSetId) + , Status(NYdb::EStatus::SUCCESS) , RowsCount(rowsCount) + , Truncated(truncated) {} + const ui64 ResultSetId; NYql::TIssues Issues; NYdb::EStatus Status; int64_t RowsCount = 0; + bool Truncated = false; }; struct TEvSynchronizeRequest : public NActors::TEventLocal<TEvSynchronizeRequest, EvSynchronizeRequest> { @@ -334,7 +339,7 @@ struct TEvYdbCompute { {} TEvSynchronizeResponse(const TString& scope, NYql::TIssues issues, NYdb::EStatus status) - : Scope(scope) + : Scope(scope) , Issues(std::move(issues)) , Status(status) {} diff --git a/ydb/core/fq/libs/compute/ydb/result_writer_actor.cpp b/ydb/core/fq/libs/compute/ydb/result_writer_actor.cpp index 0f142492ac..65297ced74 100644 --- a/ydb/core/fq/libs/compute/ydb/result_writer_actor.cpp +++ b/ydb/core/fq/libs/compute/ydb/result_writer_actor.cpp @@ -90,12 +90,13 @@ public: const auto& response = *ev.Get()->Get(); if (response.Status != NYdb::EStatus::SUCCESS) { LOG_E("Can't fetch script result: " << ev->Get()->Issues.ToOneLineString()); - Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(ev->Get()->Issues, NYdb::EStatus::INTERNAL_ERROR)); + Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(ResultSetId, ev->Get()->Issues, NYdb::EStatus::INTERNAL_ERROR)); FailedAndPassAway(); return; } StartTime = TInstant::Now(); + Truncated |= response.ResultSet->Truncated(); FetchToken = response.NextFetchToken; auto emptyResultSet = response.ResultSet->RowsCount() == 0; const auto resultSetProto = NYdb::TProtoAccessor::GetProto(*response.ResultSet); @@ -131,7 +132,7 @@ public: } else { writeResultCounters->Error->Inc(); LOG_E("Error writing result for offset " << Offset); - Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(NYql::TIssues{NYql::TIssue{TStringBuilder{} << "Error writing result for offset " << Offset}}, NYdb::EStatus::INTERNAL_ERROR)); + Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(ResultSetId, NYql::TIssues{NYql::TIssue{TStringBuilder{} << "Error writing result for offset " << Offset}}, NYdb::EStatus::INTERNAL_ERROR)); FailedAndPassAway(); } } @@ -144,7 +145,7 @@ public: } void SendReplyAndPassAway() { - Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(Offset)); + Send(Parent, new TEvYdbCompute::TEvResultSetWriterResponse(ResultSetId, Offset, Truncated)); PassAway(); } @@ -167,6 +168,7 @@ private: TCounters Counters; TInstant StartTime; int64_t Offset = 0; + bool Truncated = false; TString FetchToken; }; @@ -256,7 +258,6 @@ public: for (const auto& column: resultSetMeta.columns()) { *meta.add_column() = column; } - meta.set_truncated(resultSetMeta.truncated()); } WriteNextResultSet(); @@ -287,7 +288,15 @@ public: FailedAndPassAway(); return; } - PingTaskRequest.mutable_result_set_meta(CurrentResultSetId - 1)->set_rows_count(ev->Get()->RowsCount); + if (response.ResultSetId >= static_cast<ui64>(PingTaskRequest.result_set_meta_size())) { + LOG_E("Can't fetch script result: internal error"); + Send(Parent, new TEvYdbCompute::TEvResultWriterResponse(ev->Get()->Issues, NYdb::EStatus::INTERNAL_ERROR)); + FailedAndPassAway(); + return; + } + auto* meta = PingTaskRequest.mutable_result_set_meta(response.ResultSetId); + meta->set_rows_count(response.RowsCount); + meta->set_truncated(response.Truncated); WriteNextResultSet(); } diff --git a/ydb/core/kqp/proxy_service/CMakeLists.darwin-x86_64.txt b/ydb/core/kqp/proxy_service/CMakeLists.darwin-x86_64.txt index e204bf29d8..74fe7fa615 100644 --- a/ydb/core/kqp/proxy_service/CMakeLists.darwin-x86_64.txt +++ b/ydb/core/kqp/proxy_service/CMakeLists.darwin-x86_64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(proto) add_subdirectory(ut) add_library(core-kqp-proxy_service) @@ -24,6 +25,7 @@ target_link_libraries(core-kqp-proxy_service PUBLIC core-kqp-common kqp-common-events core-kqp-counters + kqp-proxy_service-proto core-kqp-run_script_actor ydb-core-mind ydb-core-protos diff --git a/ydb/core/kqp/proxy_service/CMakeLists.linux-aarch64.txt b/ydb/core/kqp/proxy_service/CMakeLists.linux-aarch64.txt index 2c471136bb..87e67e8adf 100644 --- a/ydb/core/kqp/proxy_service/CMakeLists.linux-aarch64.txt +++ b/ydb/core/kqp/proxy_service/CMakeLists.linux-aarch64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(proto) add_subdirectory(ut) add_library(core-kqp-proxy_service) @@ -25,6 +26,7 @@ target_link_libraries(core-kqp-proxy_service PUBLIC core-kqp-common kqp-common-events core-kqp-counters + kqp-proxy_service-proto core-kqp-run_script_actor ydb-core-mind ydb-core-protos diff --git a/ydb/core/kqp/proxy_service/CMakeLists.linux-x86_64.txt b/ydb/core/kqp/proxy_service/CMakeLists.linux-x86_64.txt index 2c471136bb..87e67e8adf 100644 --- a/ydb/core/kqp/proxy_service/CMakeLists.linux-x86_64.txt +++ b/ydb/core/kqp/proxy_service/CMakeLists.linux-x86_64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(proto) add_subdirectory(ut) add_library(core-kqp-proxy_service) @@ -25,6 +26,7 @@ target_link_libraries(core-kqp-proxy_service PUBLIC core-kqp-common kqp-common-events core-kqp-counters + kqp-proxy_service-proto core-kqp-run_script_actor ydb-core-mind ydb-core-protos diff --git a/ydb/core/kqp/proxy_service/CMakeLists.windows-x86_64.txt b/ydb/core/kqp/proxy_service/CMakeLists.windows-x86_64.txt index e204bf29d8..74fe7fa615 100644 --- a/ydb/core/kqp/proxy_service/CMakeLists.windows-x86_64.txt +++ b/ydb/core/kqp/proxy_service/CMakeLists.windows-x86_64.txt @@ -6,6 +6,7 @@ # original buildsystem will not be accepted. +add_subdirectory(proto) add_subdirectory(ut) add_library(core-kqp-proxy_service) @@ -24,6 +25,7 @@ target_link_libraries(core-kqp-proxy_service PUBLIC core-kqp-common kqp-common-events core-kqp-counters + kqp-proxy_service-proto core-kqp-run_script_actor ydb-core-mind ydb-core-protos diff --git a/ydb/core/kqp/proxy_service/kqp_script_executions.cpp b/ydb/core/kqp/proxy_service/kqp_script_executions.cpp index d00666403f..099bcc5a51 100644 --- a/ydb/core/kqp/proxy_service/kqp_script_executions.cpp +++ b/ydb/core/kqp/proxy_service/kqp_script_executions.cpp @@ -5,6 +5,7 @@ #include <ydb/core/grpc_services/rpc_kqp_base.h> #include <ydb/core/kqp/common/events/events.h> #include <ydb/core/kqp/common/kqp_script_executions.h> +#include <ydb/core/kqp/proxy_service/proto/result_set_meta.pb.h> #include <ydb/core/kqp/run_script_actor/kqp_run_script_actor.h> #include <ydb/library/services/services.pb.h> #include <ydb/library/query_actor/query_actor.h> @@ -1883,7 +1884,7 @@ public: return; } - Ydb::Query::ResultSetMeta meta; + Ydb::Query::Internal::ResultSetMeta meta; NProtobufJson::Json2Proto(*metaValue, meta); *Response->Record.MutableResultSet()->mutable_columns() = meta.columns(); diff --git a/ydb/core/kqp/proxy_service/proto/CMakeLists.darwin-x86_64.txt b/ydb/core/kqp/proxy_service/proto/CMakeLists.darwin-x86_64.txt new file mode 100644 index 0000000000..77043f71f6 --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/CMakeLists.darwin-x86_64.txt @@ -0,0 +1,44 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +get_built_tool_path( + TOOL_protoc_bin + TOOL_protoc_dependency + contrib/tools/protoc/bin + protoc +) +get_built_tool_path( + TOOL_cpp_styleguide_bin + TOOL_cpp_styleguide_dependency + contrib/tools/protoc/plugins/cpp_styleguide + cpp_styleguide +) + +add_library(kqp-proxy_service-proto) +target_link_libraries(kqp-proxy_service-proto PUBLIC + contrib-libs-cxxsupp + yutil + api-protos + contrib-libs-protobuf +) +target_proto_messages(kqp-proxy_service-proto PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/kqp/proxy_service/proto/result_set_meta.proto +) +target_proto_addincls(kqp-proxy_service-proto + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(kqp-proxy_service-proto + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/ydb/core/kqp/proxy_service/proto/CMakeLists.linux-aarch64.txt b/ydb/core/kqp/proxy_service/proto/CMakeLists.linux-aarch64.txt new file mode 100644 index 0000000000..d82687a820 --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/CMakeLists.linux-aarch64.txt @@ -0,0 +1,45 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +get_built_tool_path( + TOOL_protoc_bin + TOOL_protoc_dependency + contrib/tools/protoc/bin + protoc +) +get_built_tool_path( + TOOL_cpp_styleguide_bin + TOOL_cpp_styleguide_dependency + contrib/tools/protoc/plugins/cpp_styleguide + cpp_styleguide +) + +add_library(kqp-proxy_service-proto) +target_link_libraries(kqp-proxy_service-proto PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + api-protos + contrib-libs-protobuf +) +target_proto_messages(kqp-proxy_service-proto PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/kqp/proxy_service/proto/result_set_meta.proto +) +target_proto_addincls(kqp-proxy_service-proto + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(kqp-proxy_service-proto + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/ydb/core/kqp/proxy_service/proto/CMakeLists.linux-x86_64.txt b/ydb/core/kqp/proxy_service/proto/CMakeLists.linux-x86_64.txt new file mode 100644 index 0000000000..d82687a820 --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/CMakeLists.linux-x86_64.txt @@ -0,0 +1,45 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +get_built_tool_path( + TOOL_protoc_bin + TOOL_protoc_dependency + contrib/tools/protoc/bin + protoc +) +get_built_tool_path( + TOOL_cpp_styleguide_bin + TOOL_cpp_styleguide_dependency + contrib/tools/protoc/plugins/cpp_styleguide + cpp_styleguide +) + +add_library(kqp-proxy_service-proto) +target_link_libraries(kqp-proxy_service-proto PUBLIC + contrib-libs-linux-headers + contrib-libs-cxxsupp + yutil + api-protos + contrib-libs-protobuf +) +target_proto_messages(kqp-proxy_service-proto PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/kqp/proxy_service/proto/result_set_meta.proto +) +target_proto_addincls(kqp-proxy_service-proto + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(kqp-proxy_service-proto + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/ydb/core/kqp/proxy_service/proto/CMakeLists.txt b/ydb/core/kqp/proxy_service/proto/CMakeLists.txt new file mode 100644 index 0000000000..f8b31df0c1 --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/CMakeLists.txt @@ -0,0 +1,17 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-aarch64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + include(CMakeLists.darwin-x86_64.txt) +elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA) + include(CMakeLists.windows-x86_64.txt) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA) + include(CMakeLists.linux-x86_64.txt) +endif() diff --git a/ydb/core/kqp/proxy_service/proto/CMakeLists.windows-x86_64.txt b/ydb/core/kqp/proxy_service/proto/CMakeLists.windows-x86_64.txt new file mode 100644 index 0000000000..77043f71f6 --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/CMakeLists.windows-x86_64.txt @@ -0,0 +1,44 @@ + +# This file was generated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + +get_built_tool_path( + TOOL_protoc_bin + TOOL_protoc_dependency + contrib/tools/protoc/bin + protoc +) +get_built_tool_path( + TOOL_cpp_styleguide_bin + TOOL_cpp_styleguide_dependency + contrib/tools/protoc/plugins/cpp_styleguide + cpp_styleguide +) + +add_library(kqp-proxy_service-proto) +target_link_libraries(kqp-proxy_service-proto PUBLIC + contrib-libs-cxxsupp + yutil + api-protos + contrib-libs-protobuf +) +target_proto_messages(kqp-proxy_service-proto PRIVATE + ${CMAKE_SOURCE_DIR}/ydb/core/kqp/proxy_service/proto/result_set_meta.proto +) +target_proto_addincls(kqp-proxy_service-proto + ./ + ${CMAKE_SOURCE_DIR}/ + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src + ${CMAKE_BINARY_DIR} + ${CMAKE_SOURCE_DIR}/contrib/libs/protobuf/src +) +target_proto_outs(kqp-proxy_service-proto + --cpp_out=${CMAKE_BINARY_DIR}/ + --cpp_styleguide_out=${CMAKE_BINARY_DIR}/ +) diff --git a/ydb/core/kqp/proxy_service/proto/result_set_meta.proto b/ydb/core/kqp/proxy_service/proto/result_set_meta.proto new file mode 100644 index 0000000000..831ef5d86c --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/result_set_meta.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +option cc_enable_arenas = true; + +package Ydb.Query.Internal; + +import "ydb/public/api/protos/ydb_value.proto"; + +message ResultSetMeta { + repeated Ydb.Column columns = 1; + + bool truncated = 2; +} diff --git a/ydb/core/kqp/proxy_service/proto/ya.make b/ydb/core/kqp/proxy_service/proto/ya.make new file mode 100644 index 0000000000..6646cb856c --- /dev/null +++ b/ydb/core/kqp/proxy_service/proto/ya.make @@ -0,0 +1,11 @@ +LIBRARY() + +SRCS( + result_set_meta.proto +) + +PEERDIR( + ydb/public/api/protos +) + +END() diff --git a/ydb/core/kqp/proxy_service/ya.make b/ydb/core/kqp/proxy_service/ya.make index a919719387..f7f95f81fa 100644 --- a/ydb/core/kqp/proxy_service/ya.make +++ b/ydb/core/kqp/proxy_service/ya.make @@ -17,6 +17,7 @@ PEERDIR( ydb/core/kqp/common ydb/core/kqp/common/events ydb/core/kqp/counters + ydb/core/kqp/proxy_service/proto ydb/core/kqp/run_script_actor ydb/core/mind ydb/core/protos @@ -36,6 +37,10 @@ YQL_LAST_ABI_VERSION() END() +RECURSE( + proto +) + RECURSE_FOR_TESTS( ut ) diff --git a/ydb/core/kqp/run_script_actor/CMakeLists.darwin-x86_64.txt b/ydb/core/kqp/run_script_actor/CMakeLists.darwin-x86_64.txt index dc4d457a24..87db7fa45c 100644 --- a/ydb/core/kqp/run_script_actor/CMakeLists.darwin-x86_64.txt +++ b/ydb/core/kqp/run_script_actor/CMakeLists.darwin-x86_64.txt @@ -20,6 +20,7 @@ target_link_libraries(core-kqp-run_script_actor PUBLIC ydb-core-protos kqp-common-events core-kqp-executer_actor + kqp-proxy_service-proto api-protos ) target_sources(core-kqp-run_script_actor PRIVATE diff --git a/ydb/core/kqp/run_script_actor/CMakeLists.linux-aarch64.txt b/ydb/core/kqp/run_script_actor/CMakeLists.linux-aarch64.txt index 64bce9401b..0efb7fb84c 100644 --- a/ydb/core/kqp/run_script_actor/CMakeLists.linux-aarch64.txt +++ b/ydb/core/kqp/run_script_actor/CMakeLists.linux-aarch64.txt @@ -21,6 +21,7 @@ target_link_libraries(core-kqp-run_script_actor PUBLIC ydb-core-protos kqp-common-events core-kqp-executer_actor + kqp-proxy_service-proto api-protos ) target_sources(core-kqp-run_script_actor PRIVATE diff --git a/ydb/core/kqp/run_script_actor/CMakeLists.linux-x86_64.txt b/ydb/core/kqp/run_script_actor/CMakeLists.linux-x86_64.txt index 64bce9401b..0efb7fb84c 100644 --- a/ydb/core/kqp/run_script_actor/CMakeLists.linux-x86_64.txt +++ b/ydb/core/kqp/run_script_actor/CMakeLists.linux-x86_64.txt @@ -21,6 +21,7 @@ target_link_libraries(core-kqp-run_script_actor PUBLIC ydb-core-protos kqp-common-events core-kqp-executer_actor + kqp-proxy_service-proto api-protos ) target_sources(core-kqp-run_script_actor PRIVATE diff --git a/ydb/core/kqp/run_script_actor/CMakeLists.windows-x86_64.txt b/ydb/core/kqp/run_script_actor/CMakeLists.windows-x86_64.txt index dc4d457a24..87db7fa45c 100644 --- a/ydb/core/kqp/run_script_actor/CMakeLists.windows-x86_64.txt +++ b/ydb/core/kqp/run_script_actor/CMakeLists.windows-x86_64.txt @@ -20,6 +20,7 @@ target_link_libraries(core-kqp-run_script_actor PUBLIC ydb-core-protos kqp-common-events core-kqp-executer_actor + kqp-proxy_service-proto api-protos ) target_sources(core-kqp-run_script_actor PRIVATE diff --git a/ydb/core/kqp/run_script_actor/kqp_run_script_actor.cpp b/ydb/core/kqp/run_script_actor/kqp_run_script_actor.cpp index 69315beca5..669512139b 100644 --- a/ydb/core/kqp/run_script_actor/kqp_run_script_actor.cpp +++ b/ydb/core/kqp/run_script_actor/kqp_run_script_actor.cpp @@ -5,6 +5,7 @@ #include <ydb/core/kqp/common/kqp.h> #include <ydb/core/kqp/executer_actor/kqp_executer.h> #include <ydb/core/kqp/proxy_service/kqp_script_executions.h> +#include <ydb/core/kqp/proxy_service/proto/result_set_meta.pb.h> #include <ydb/library/ydb_issue/proto/issue_id.pb.h> #include <ydb/public/api/protos/ydb_status_codes.pb.h> @@ -169,7 +170,7 @@ private: Issues, std::move(QueryStats), std::move(QueryPlan), std::move(QueryAst))); return; } - + if (RunState != ERunState::Cancelled && RunState != ERunState::Finished) { RunState = ERunState::Finished; TerminateActorExecution(Ydb::StatusIds::PRECONDITION_FAILED, { NYql::TIssue("Already finished") }); @@ -220,7 +221,7 @@ private: if (resultSetIndex >= ExpireAt.size()) { // we don't know result set count, so just accept all of them // it's possible to have several result sets per script - // they can arrive in any order and may be missed for some indices + // they can arrive in any order and may be missed for some indices ResultSetRowCount.resize(resultSetIndex + 1); ResultSetByteCount.resize(resultSetIndex + 1); Truncated.resize(resultSetIndex + 1); @@ -255,7 +256,7 @@ private: } if (firstRow == 0 || Truncated[resultSetIndex]) { - Ydb::Query::ResultSetMeta meta; + Ydb::Query::Internal::ResultSetMeta meta; *meta.mutable_columns() = ev->Get()->Record.GetResultSet().columns(); meta.set_truncated(Truncated[resultSetIndex]); @@ -299,10 +300,10 @@ private: return; } auto& record = ev->Get()->Record.GetRef(); - + const auto& issueMessage = record.GetResponse().GetQueryIssues(); NYql::IssuesFromMessage(issueMessage, Issues); - + if (record.GetResponse().HasQueryPlan()) { QueryPlan = record.GetResponse().GetQueryPlan(); } diff --git a/ydb/core/kqp/run_script_actor/ya.make b/ydb/core/kqp/run_script_actor/ya.make index 46d6a0567d..b7bfa28dcb 100644 --- a/ydb/core/kqp/run_script_actor/ya.make +++ b/ydb/core/kqp/run_script_actor/ya.make @@ -11,6 +11,7 @@ PEERDIR( ydb/core/protos ydb/core/kqp/common/events ydb/core/kqp/executer_actor + ydb/core/kqp/proxy_service/proto ydb/public/api/protos ) diff --git a/ydb/core/kqp/ut/service/kqp_query_service_ut.cpp b/ydb/core/kqp/ut/service/kqp_query_service_ut.cpp index c0ecc6d7b7..09b2c7b7f3 100644 --- a/ydb/core/kqp/ut/service/kqp_query_service_ut.cpp +++ b/ydb/core/kqp/ut/service/kqp_query_service_ut.cpp @@ -527,7 +527,6 @@ Y_UNIT_TEST_SUITE(KqpQueryService) { UNIT_ASSERT_STRING_CONTAINS(readyOp.Metadata().ScriptContent.Text, "SELECT 42"); UNIT_ASSERT_VALUES_EQUAL(readyOp.Metadata().ResultSetsMeta.size(), 1); UNIT_ASSERT_VALUES_EQUAL(readyOp.Metadata().ResultSetsMeta.front().columns_size(), 1); - UNIT_ASSERT_VALUES_EQUAL(readyOp.Metadata().ResultSetsMeta.front().truncated(), false); UNIT_ASSERT_VALUES_EQUAL(readyOp.Metadata().ResultSetsMeta.front().columns(0).name(), "column0"); UNIT_ASSERT_EQUAL(readyOp.Metadata().ResultSetsMeta.front().columns(0).type().type_id(), Ydb::Type::PrimitiveTypeId::Type_PrimitiveTypeId_INT32); diff --git a/ydb/public/api/protos/ydb_query.proto b/ydb/public/api/protos/ydb_query.proto index 0c772e05a1..2ba8e24942 100644 --- a/ydb/public/api/protos/ydb_query.proto +++ b/ydb/public/api/protos/ydb_query.proto @@ -171,9 +171,6 @@ message ExecuteQueryRequest { message ResultSetMeta { repeated Ydb.Column columns = 1; - - // TODO: Remove. - bool truncated = 2; } message ExecuteQueryResponsePart { |