aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhcpp <hcpp@ydb.tech>2023-04-18 19:20:21 +0300
committerhcpp <hcpp@ydb.tech>2023-04-18 19:20:21 +0300
commit2a82c4821062c12e48bc7241f02ea8d72f19f8e8 (patch)
treee353b133cfeaad7321e298f4f55d016df5ed0df5
parentd69716a6b1a85d5a9d9e5476aaf7d3c28fb2f7b8 (diff)
downloadydb-2a82c4821062c12e48bc7241f02ea8d72f19f8e8.tar.gz
exception from ConvertYson2Json has been handled
-rw-r--r--ydb/core/fq/libs/actors/run_actor.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/ydb/core/fq/libs/actors/run_actor.cpp b/ydb/core/fq/libs/actors/run_actor.cpp
index e9c5aeb216..15f11da543 100644
--- a/ydb/core/fq/libs/actors/run_actor.cpp
+++ b/ydb/core/fq/libs/actors/run_actor.cpp
@@ -83,6 +83,8 @@
#define LOG_W(stream) LOG_WARN_S( *TlsActivationContext, NKikimrServices::FQ_RUN_ACTOR, "QueryId: " << Params.QueryId << " " << stream)
#define LOG_D(stream) LOG_DEBUG_S(*TlsActivationContext, NKikimrServices::FQ_RUN_ACTOR, "QueryId: " << Params.QueryId << " " << stream)
#define LOG_T(stream) LOG_TRACE_S(*TlsActivationContext, NKikimrServices::FQ_RUN_ACTOR, "QueryId: " << Params.QueryId << " " << stream)
+#define LOG_QE(stream) LOG_ERROR_S(*TlsActivationContext, NKikimrServices::FQ_RUN_ACTOR, "QueryId: " << QueryId << " " << stream)
+#define LOG_QW(stream) LOG_WARN_S( *TlsActivationContext, NKikimrServices::FQ_RUN_ACTOR, "QueryId: " << QueryId << " " << stream)
namespace NFq {
@@ -134,7 +136,8 @@ public:
const TString& sql,
const TString& sessionId,
const NSQLTranslation::TTranslationSettings& sqlSettings,
- FederatedQuery::ExecuteMode executeMode
+ FederatedQuery::ExecuteMode executeMode,
+ const TString& queryId
)
: RunActorId(runActorId)
, FunctionRegistry(functionRegistry)
@@ -146,6 +149,7 @@ public:
, SessionId(sessionId)
, SqlSettings(sqlSettings)
, ExecuteMode(executeMode)
+ , QueryId(queryId)
{
}
@@ -217,7 +221,7 @@ public:
TStringStream exprOut;
TStringStream planOut;
Program->Print(&exprOut, &planOut);
- plan = NJson2Yson::ConvertYson2Json(planOut.Str());
+ plan = Plan2Json(planOut.Str());
expr = exprOut.Str();
}
Issues.AddIssues(Program->Issues());
@@ -248,6 +252,19 @@ public:
SendStatusAndDie(status);
}
+ TString Plan2Json(const TString& ysonPlan) {
+ if (!ysonPlan) {
+ LOG_QW("Can't convert plan from yson to json: plan is empty");
+ return {};
+ }
+ try {
+ return NJson2Yson::ConvertYson2Json(ysonPlan);
+ } catch (...) {
+ LOG_QE("Can't convert plan from yson to json: " << CurrentExceptionMessage());
+ }
+ return {};
+ }
+
private:
TProgramPtr Program;
TIssues Issues;
@@ -261,6 +278,7 @@ private:
const TString SessionId;
const NSQLTranslation::TTranslationSettings SqlSettings;
const FederatedQuery::ExecuteMode ExecuteMode;
+ const TString QueryId;
bool Compiled = false;
};
@@ -1855,7 +1873,8 @@ private:
Params.Sql,
SessionId,
sqlSettings,
- Params.ExecuteMode
+ Params.ExecuteMode,
+ Params.QueryId
));
}