Skip to content

Commit

Permalink
Merge f48e1e2 into e1ce008
Browse files Browse the repository at this point in the history
  • Loading branch information
shnikd authored Dec 28, 2024
2 parents e1ce008 + f48e1e2 commit c744a81
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 18 additions & 0 deletions ydb/core/grpc_services/query/rpc_execute_query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ class TExecuteQueryRPC : public TActorBootstrapped<TExecuteQueryRPC> {
HFunc(TEvents::TEvWakeup, Handle);
HFunc(TRpcServices::TEvGrpcNextReply, Handle);
HFunc(NKqp::TEvKqpExecuter::TEvStreamData, Handle);
HFunc(NKqp::TEvKqpExecuter::TEvExecuterProgress, Handle);
HFunc(NKqp::TEvKqp::TEvQueryResponse, Handle);
hFunc(NKikimr::NGRpcService::TEvSubscribeGrpcCancel, Handle);
default:
Expand Down Expand Up @@ -353,6 +354,23 @@ class TExecuteQueryRPC : public TActorBootstrapped<TExecuteQueryRPC> {
channel.SendAck(SelfId());
}

void Handle(NKqp::TEvKqpExecuter::TEvExecuterProgress::TPtr& ev, const TActorContext& ctx) {
auto& record = ev->Get()->Record;

Ydb::Query::ExecuteQueryResponsePart response;
response.set_status(Ydb::StatusIds::SUCCESS);
if (NeedReportStats(*Request_->GetProtoRequest())) {
FillQueryStats(*response.mutable_exec_stats(), record.GetQueryStats());
}

TString out;
Y_PROTOBUF_SUPPRESS_NODISCARD response.SerializeToString(&out);

FlowControl_.PushResponse(out.size());

Request_->SendSerializedResult(std::move(out), Ydb::StatusIds::SUCCESS);
}

void Handle(NKqp::TEvKqp::TEvQueryResponse::TPtr& ev, const TActorContext& ctx) {
NDataIntegrity::LogIntegrityTrails(Request_->GetTraceId(), *Request_->GetProtoRequest(), ev, ctx);

Expand Down
6 changes: 1 addition & 5 deletions ydb/public/lib/ydb_cli/commands/ydb_sql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@ int TCommandSql::PrintResponse(NQuery::TExecuteQueryIterator& result) {
if (!streamPart.GetStats().Empty()) {
const auto& queryStats = *streamPart.GetStats();
stats = queryStats.ToString();
ast = queryStats.GetAst();

if (queryStats.GetPlan()) {
plan = queryStats.GetPlan();
}
Cout << Endl << "Current statistics:" << Endl << *stats;
}
}
} // TResultSetPrinter destructor should be called before printing stats
Expand Down

0 comments on commit c744a81

Please sign in to comment.