Skip to content

Commit 4f9aa39

Browse files
authored
drop some dead code (#6957)
1 parent 6a2d1fe commit 4f9aa39

File tree

8 files changed

+15
-89
lines changed

8 files changed

+15
-89
lines changed

ydb/core/kqp/common/events/events.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#pragma once
22

3-
#include "process_response.h"
43
#include "query.h"
54

65
#include <ydb/core/kqp/common/simple/kqp_event_ids.h>
@@ -21,8 +20,6 @@ namespace NKikimr::NKqp {
2120
struct TEvKqp {
2221
using TEvQueryRequestRemote = NPrivateEvents::TEvQueryRequestRemote;
2322

24-
using TEvProcessResponse = NPrivateEvents::TEvProcessResponse;
25-
2623
using TEvQueryRequest = NPrivateEvents::TEvQueryRequest;
2724

2825
struct TEvCloseSessionRequest : public TEventPB<TEvCloseSessionRequest,

ydb/core/kqp/common/events/process_response.cpp

Lines changed: 0 additions & 4 deletions
This file was deleted.

ydb/core/kqp/common/events/process_response.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

ydb/core/kqp/common/events/ya.make

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
LIBRARY()
22

33
SRCS(
4-
process_response.cpp
54
events.cpp
65
query.cpp
76
script_executions.cpp

ydb/core/kqp/provider/yql_kikimr_gateway.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,6 @@ class IKikimrGateway : public TThrRefBase {
884884
struct TQueryResult : public TGenericResult {
885885
TString SessionId;
886886
TVector<NKikimrMiniKQL::TResult*> Results;
887-
TMaybe<NKikimrKqp::TQueryProfile> Profile; // TODO: Deprecate.
888887
NKqpProto::TKqpStatsQuery QueryStats;
889888
std::unique_ptr<NKikimrKqp::TPreparedQuery> PreparingQuery;
890889
std::shared_ptr<const NKikimrKqp::TPreparedQuery> PreparedQuery;

ydb/core/kqp/proxy_service/kqp_proxy_service.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,6 @@ class TKqpProxyService : public TActorBootstrapped<TKqpProxyService> {
13311331
hFunc(TEvKqp::TEvCloseSessionRequest, Handle);
13321332
hFunc(TEvKqp::TEvQueryResponse, ForwardEvent);
13331333
hFunc(TEvKqpExecuter::TEvExecuterProgress, ForwardProgress);
1334-
hFunc(TEvKqp::TEvProcessResponse, Handle);
13351334
hFunc(TEvKqp::TEvCreateSessionRequest, Handle);
13361335
hFunc(TEvKqp::TEvPingSessionRequest, Handle);
13371336
hFunc(TEvKqp::TEvCancelQueryRequest, Handle);
@@ -1360,16 +1359,6 @@ class TKqpProxyService : public TActorBootstrapped<TKqpProxyService> {
13601359
}
13611360

13621361
private:
1363-
void LogResponse(const TKqpRequestInfo& requestInfo,
1364-
const NKikimrKqp::TEvProcessResponse& event, TKqpDbCountersPtr dbCounters)
1365-
{
1366-
auto status = event.GetYdbStatus();
1367-
if (status != Ydb::StatusIds::SUCCESS) {
1368-
KQP_PROXY_LOG_W(requestInfo << event.GetError());
1369-
}
1370-
1371-
Counters->ReportResponseStatus(dbCounters, event.ByteSize(), status);
1372-
}
13731362

13741363
void LogResponse(const TKqpRequestInfo&,
13751364
const NKikimrKqp::TEvCreateSessionResponse& event, TKqpDbCountersPtr dbCounters)
@@ -1384,11 +1373,6 @@ class TKqpProxyService : public TActorBootstrapped<TKqpProxyService> {
13841373
Counters->ReportResponseStatus(dbCounters, event.ByteSize(), event.GetStatus());
13851374
}
13861375

1387-
1388-
void Handle(TEvKqp::TEvProcessResponse::TPtr&ev) {
1389-
ReplyProcessError(ev->Get()->Record.GetYdbStatus(), ev->Get()->Record.GetError(), ev->Cookie);
1390-
}
1391-
13921376
bool ReplyProcessError(Ydb::StatusIds::StatusCode ydbStatus, const TString& message, ui64 requestId)
13931377
{
13941378
auto issue = NKikimr::MakeIssue(NKikimrIssues::TIssuesIds::DEFAULT_ERROR, message);

ydb/core/kqp/session_actor/kqp_worker_actor.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ namespace {
4444

4545
using TQueryResult = IKqpHost::TQueryResult;
4646

47+
enum EReplyFlags : ui32 {
48+
QUERY_REPLY_FLAG_RESULTS = 1,
49+
QUERY_REPLY_FLAG_PLAN = 2,
50+
QUERY_REPLY_FLAG_AST = 4,
51+
};
52+
4753
struct TKqpQueryState {
4854
TActorId Sender;
4955
ui64 ProxyRequestId = 0;
@@ -194,10 +200,10 @@ class TKqpWorkerActor : public TActorBootstrapped<TKqpWorkerActor> {
194200
QueryState->ProxyRequestId = proxyRequestId;
195201
QueryState->KeepSession = Settings.LongSession || queryRequest->GetKeepSession();
196202
QueryState->StartTime = now;
197-
QueryState->ReplyFlags = queryRequest->Record.GetRequest().GetReplyFlags();
203+
QueryState->ReplyFlags = EReplyFlags::QUERY_REPLY_FLAG_RESULTS;
198204

199205
if (GetStatsMode(QueryState->RequestEv.get(), EKikimrStatsMode::None) > EKikimrStatsMode::Basic) {
200-
QueryState->ReplyFlags |= NKikimrKqp::QUERY_REPLY_FLAG_AST;
206+
QueryState->ReplyFlags |= EReplyFlags::QUERY_REPLY_FLAG_AST;
201207
}
202208

203209
NCpuTime::TCpuTimer timer;
@@ -477,7 +483,7 @@ class TKqpWorkerActor : public TActorBootstrapped<TKqpWorkerActor> {
477483

478484
case NKikimrKqp::QUERY_ACTION_EXPLAIN: {
479485
// Force reply flags
480-
QueryState->ReplyFlags |= NKikimrKqp::QUERY_REPLY_FLAG_PLAN | NKikimrKqp::QUERY_REPLY_FLAG_AST;
486+
QueryState->ReplyFlags |= EReplyFlags::QUERY_REPLY_FLAG_PLAN | EReplyFlags::QUERY_REPLY_FLAG_AST;
481487
if (!ExplainQuery(ctx, QueryState->RequestEv->GetQuery(), queryType)) {
482488
onBadRequest(QueryState->Error);
483489
return;
@@ -936,9 +942,9 @@ class TKqpWorkerActor : public TActorBootstrapped<TKqpWorkerActor> {
936942
bool replyAst = true;
937943

938944
// TODO: Handle in KQP to avoid generation of redundant data
939-
replyResults = replyResults && (QueryState->ReplyFlags & NKikimrKqp::QUERY_REPLY_FLAG_RESULTS);
940-
replyPlan = replyPlan && (QueryState->ReplyFlags & NKikimrKqp::QUERY_REPLY_FLAG_PLAN);
941-
replyAst = replyAst && (QueryState->ReplyFlags & NKikimrKqp::QUERY_REPLY_FLAG_AST);
945+
replyResults = replyResults && (QueryState->ReplyFlags & EReplyFlags::QUERY_REPLY_FLAG_RESULTS);
946+
replyPlan = replyPlan && (QueryState->ReplyFlags & EReplyFlags::QUERY_REPLY_FLAG_PLAN);
947+
replyAst = replyAst && (QueryState->ReplyFlags & EReplyFlags::QUERY_REPLY_FLAG_AST);
942948

943949
auto ydbStatus = GetYdbStatus(queryResult);
944950
auto issues = queryResult.Issues();

ydb/core/protos/kqp.proto

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ enum EIsolationLevel {
6666
ISOLATION_LEVEL_READ_STALE = 4;
6767
};
6868

69-
enum EQueryReplyFlags {
70-
QUERY_REPLY_FLAG_RESULTS = 1;
71-
QUERY_REPLY_FLAG_PLAN = 2;
72-
QUERY_REPLY_FLAG_AST = 4;
73-
};
74-
7569
message TTopicOperationsRequest {
7670
optional string Consumer = 1;
7771
repeated Ydb.Topic.UpdateOffsetsInTransactionRequest.TopicOffsets Topics = 2;
@@ -99,7 +93,8 @@ message TQueryRequest {
9993
optional EQueryAction Action = 9;
10094
reserved 10; // (deprecated) Profile
10195
optional bytes PreparedQuery = 11;
102-
optional uint32 ReplyFlags = 12 [default = 1];
96+
// optional uint32 ReplyFlags = 12 [default = 1];
97+
reserved 12;
10398
optional Ydb.Table.TransactionControl TxControl = 13;
10499
optional string Database = 14;
105100
optional Ydb.Table.QueryCachePolicy QueryCachePolicy = 15;
@@ -211,35 +206,6 @@ message TEvQueryRequest {
211206
optional NActorsProto.TActorId CancelationActor = 9;
212207
}
213208

214-
message TMkqlProfile {
215-
optional string Query = 1;
216-
optional NKikimrQueryStats.TTxStats TxStats = 2;
217-
};
218-
219-
message TTransformProfile {
220-
optional string Name = 1;
221-
optional uint64 TransformDurationUs = 2;
222-
optional uint64 WaitDurationUs = 3;
223-
optional int32 NewExprNodes = 4;
224-
optional int32 NewTypeNodes = 5;
225-
optional uint32 Repeats = 6;
226-
optional uint32 Restarts = 7;
227-
228-
repeated TTransformProfile Stages = 100;
229-
}
230-
231-
message TKqlProfile {
232-
optional string Query = 1;
233-
repeated TMkqlProfile MkqlProfiles = 2;
234-
optional EIsolationLevel EffectiveIsolationLevel = 3;
235-
optional TTransformProfile TransformStats = 4;
236-
}
237-
238-
message TQueryProfile {
239-
repeated TKqlProfile KqlProfiles = 1;
240-
optional TTransformProfile TransformStats = 2;
241-
};
242-
243209
message TParameterBinding {
244210
optional string Name = 1;
245211
optional uint32 MkqlIndex = 2;
@@ -331,13 +297,6 @@ message TEvCloseSessionResponse {
331297
optional TCloseSessionResponse Response = 3;
332298
}
333299

334-
message TEvProcessResponse {
335-
reserved 1; // (deprecated) KqpStatus
336-
optional bytes Error = 2;
337-
optional Ydb.StatusIds.StatusCode YdbStatus = 3;
338-
optional bool WorkerIsClosing = 4 [default = false];
339-
}
340-
341300
message TSessionInfo {
342301
optional string SessionId = 1;
343302
/// optional ui32 NodeId = 2;
@@ -587,7 +546,7 @@ message TEvStartKqpTasksRequest {
587546
optional NActorsProto.TActorId ExecuterActorId = 4;
588547
optional TKqpSnapshot Snapshot = 5;
589548
optional bool StartAllOrFail = 6 [default = true];
590-
optional uint64 OutputChunkMaxSize = 7 [default = 0]; // 0 - use some default value
549+
optional uint64 OutputChunkMaxSize = 7 [default = 0]; // 0 - use some default value
591550
optional string SerializedGUCSettings = 8;
592551
}
593552

0 commit comments

Comments
 (0)