diff options
author | ivanmorozov <ivanmorozov@yandex-team.com> | 2023-08-10 07:19:51 +0300 |
---|---|---|
committer | ivanmorozov <ivanmorozov@yandex-team.com> | 2023-08-10 07:53:14 +0300 |
commit | 36bb339adf2db71a001899be4e136e0fd9e2099d (patch) | |
tree | 5a7a0e260c1928c2bd7aa744f0e6f81212548b5b | |
parent | 52d9e5dee911101f53d54f096a3986aa2bc18621 (diff) | |
download | ydb-36bb339adf2db71a001899be4e136e0fd9e2099d.tar.gz |
KIKIMR-18932: additional logging in formatter
-rw-r--r-- | ydb/core/formats/arrow/arrow_helpers.cpp | 3 | ||||
-rw-r--r-- | ydb/core/formats/arrow/replace_key.h | 16 | ||||
-rw-r--r-- | ydb/core/formats/arrow/serializer/batch_only.cpp | 2 |
3 files changed, 20 insertions, 1 deletions
diff --git a/ydb/core/formats/arrow/arrow_helpers.cpp b/ydb/core/formats/arrow/arrow_helpers.cpp index b330b7f368..b746a8fc24 100644 --- a/ydb/core/formats/arrow/arrow_helpers.cpp +++ b/ydb/core/formats/arrow/arrow_helpers.cpp @@ -413,15 +413,18 @@ static bool IsSelfSorted(const std::shared_ptr<arrow::RecordBatch>& batch) { TRawReplaceKey current(&columns, i); if constexpr (desc) { if (prev < current) { + AFL_DEBUG(NKikimrServices::ARROW_HELPER)("event", "prev < current")("current", current.DebugString())("prev", prev.DebugString()); return false; } } else { if (current < prev) { + AFL_DEBUG(NKikimrServices::ARROW_HELPER)("event", "current < prev")("current", current.DebugString())("prev", prev.DebugString()); return false; } } if constexpr (uniq) { if (prev == current) { + AFL_DEBUG(NKikimrServices::ARROW_HELPER)("event", "equal")("current", current.DebugString())("prev", prev.DebugString()); return false; } } diff --git a/ydb/core/formats/arrow/replace_key.h b/ydb/core/formats/arrow/replace_key.h index fab522c7ab..9c9d477e20 100644 --- a/ydb/core/formats/arrow/replace_key.h +++ b/ydb/core/formats/arrow/replace_key.h @@ -5,6 +5,9 @@ #include <ydb/core/base/defs.h> #include <contrib/libs/apache/arrow/cpp/src/arrow/api.h> #include <contrib/libs/apache/arrow/cpp/src/arrow/compute/api_vector.h> + +#include <util/string/builder.h> + #include <compare> namespace NKikimr::NArrow { @@ -29,6 +32,19 @@ public: } } + TString DebugString() const { + TStringBuilder sb; + for (auto&& i : *Columns) { + auto res = i->GetScalar(Position); + if (!res.ok()) { + sb << res.status().ToString() << ";"; + } else { + sb << (*res)->ToString() << ";"; + } + } + return sb; + } + TReplaceKeyTemplate(TArrayVecPtr columns, const ui64 position) : Columns(columns) , Position(position) diff --git a/ydb/core/formats/arrow/serializer/batch_only.cpp b/ydb/core/formats/arrow/serializer/batch_only.cpp index e7fa311043..00a8b25521 100644 --- a/ydb/core/formats/arrow/serializer/batch_only.cpp +++ b/ydb/core/formats/arrow/serializer/batch_only.cpp @@ -17,7 +17,7 @@ arrow::Result<std::shared_ptr<arrow::RecordBatch>> TBatchPayloadDeserializer::Do std::shared_ptr<arrow::Buffer> buffer(std::make_shared<TBufferOverString>(data)); arrow::io::BufferReader reader(buffer); - AFL_DEBUG(NKikimrServices::ARROW_HELPER)("event", "parsing")("size", data.size())("columns", Schema->num_fields()); + AFL_TRACE(NKikimrServices::ARROW_HELPER)("event", "parsing")("size", data.size())("columns", Schema->num_fields()); auto batchResult = arrow::ipc::ReadRecordBatch(Schema, &dictMemo, options, &reader); if (!batchResult.ok()) { return batchResult; |