diff options
author | Igor Makunin <igor.makunin@gmail.com> | 2022-03-28 18:12:07 +0300 |
---|---|---|
committer | Igor Makunin <igor.makunin@gmail.com> | 2022-03-28 18:12:07 +0300 |
commit | 2c60f6865390af78aa944d689d6b3a20b0cf2f8d (patch) | |
tree | f34e0ef69f6f862a2d565eae3775727c63babf69 | |
parent | 97c93e07f9d3aa782258741cff64e48e0c1c8420 (diff) | |
download | ydb-2c60f6865390af78aa944d689d6b3a20b0cf2f8d.tar.gz |
KIKIMR-14582: provide more info on fail
ref:2b9649394ed7751a8025c7466a65418a5066ebb8
-rw-r--r-- | ydb/core/kqp/executer/kqp_data_executer.cpp | 8 | ||||
-rw-r--r-- | ydb/core/kqp/executer/kqp_executer_impl.h | 22 |
2 files changed, 22 insertions, 8 deletions
diff --git a/ydb/core/kqp/executer/kqp_data_executer.cpp b/ydb/core/kqp/executer/kqp_data_executer.cpp index 134a324507..9f37652df5 100644 --- a/ydb/core/kqp/executer/kqp_data_executer.cpp +++ b/ydb/core/kqp/executer/kqp_data_executer.cpp @@ -1071,7 +1071,8 @@ private: } default: { - YQL_ENSURE(false, "Unexpected table operation: " << (ui32) op.GetTypeCase()); + YQL_ENSURE(false, "Unexpected table operation: " << (ui32) op.GetTypeCase() << Endl + << this->DebugString()); } } } @@ -1108,7 +1109,8 @@ private: case NKqpProto::TKqpPhyConnection::kMerge: break; default: - YQL_ENSURE(false, "Unexpected connection type: " << (ui32)input.GetTypeCase()); + YQL_ENSURE(false, "Unexpected connection type: " << (ui32)input.GetTypeCase() << Endl + << this->DebugString()); } } @@ -1696,7 +1698,7 @@ public: channelDesc.SetSrcTaskId(channel.SrcTask); channelDesc.SetDstTaskId(channel.DstTask); - YQL_ENSURE(channel.SrcTask); + YQL_ENSURE(channel.SrcTask, "" << this->DebugString()); FillEndpointDesc(*channelDesc.MutableSrcEndpoint(), TasksGraph.GetTask(channel.SrcTask)); if (channel.DstTask) { diff --git a/ydb/core/kqp/executer/kqp_executer_impl.h b/ydb/core/kqp/executer/kqp_executer_impl.h index 682fa6192c..5b023d66d9 100644 --- a/ydb/core/kqp/executer/kqp_executer_impl.h +++ b/ydb/core/kqp/executer/kqp_executer_impl.h @@ -375,7 +375,7 @@ protected: break; } default: - YQL_ENSURE(false, "Unexpected task input type: " + ToString(static_cast<int>(input.Type()))); + YQL_ENSURE(false, "Unexpected task input type: " << (int) input.Type() << Endl << this->DebugString()); } for (ui64 channel : input.Channels) { @@ -387,7 +387,7 @@ protected: void FillOutputDesc(NYql::NDqProto::TTaskOutput& outputDesc, const TTaskOutput& output) { switch (output.Type) { case TTaskOutputType::Map: - YQL_ENSURE(output.Channels.size() == 1); + YQL_ENSURE(output.Channels.size() == 1, "" << this->DebugString()); outputDesc.MutableMap(); break; @@ -430,7 +430,7 @@ protected: } default: { - YQL_ENSURE(false, "Unexpected task output type " << output.Type); + YQL_ENSURE(false, "Unexpected task output type " << output.Type << Endl << this->DebugString()); } } @@ -461,7 +461,7 @@ protected: auto [type, value] = NMiniKQL::ImportValueFromProto( literalValue.GetType(), literalValue.GetValue(), typeEnv, holderFactory); - YQL_ENSURE(type->GetKind() == NMiniKQL::TType::EKind::Data); + YQL_ENSURE(type->GetKind() == NMiniKQL::TType::EKind::Data, "" << this->DebugString()); itemsLimit = value.Get<ui64>(); itemsLimitType = type; @@ -480,7 +480,7 @@ protected: auto [type, value] = NMiniKQL::ImportValueFromProto( itemsLimitParam->GetType(), itemsLimitParam->GetValue(), typeEnv, holderFactory); - YQL_ENSURE(type->GetKind() == NMiniKQL::TType::EKind::Data); + YQL_ENSURE(type->GetKind() == NMiniKQL::TType::EKind::Data, "" << this->DebugString()); itemsLimit = value.Get<ui64>(); NYql::NDq::TDqDataSerializer dataSerializer(typeEnv, holderFactory, NYql::NDqProto::DATA_TRANSPORT_UV_PICKLE_1_0); @@ -635,6 +635,18 @@ protected: } protected: + TString DebugString() const { + TStringBuilder sb; + sb << "[KqpExecuter], type: " << (ExecType == EExecType::Data ? "Data" : "Scan") + << ", Database: " << Database << ", TxId: " << TxId << ", TxCnt: " << Request.Transactions.size() + << ", Transactions: " << Endl; + for (const auto& tx : Request.Transactions) { + sb << "tx: " << tx.Body->DebugString() << Endl; + } + return std::move(sb); + } + +protected: IKqpGateway::TExecPhysicalRequest Request; const TString Database; const TMaybe<TString> UserToken; |