Skip to content

Commit

Permalink
fix addressing and additional logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 committed Sep 17, 2024
1 parent 4d2856e commit 456c37b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ class TSparsedMerger: public IColumnMerger {

void InitArrays(const ui32 position) {
AFL_VERIFY(!ChunkAddress || ChunkFinishPosition <= position);
ChunkAddress = CurrentChunkedArray->GetChunk(ChunkAddress, position);
AFL_VERIFY(CurrentOwnedArray->GetAddress().GetGlobalStartPosition() <= position)("pos", position)(
"global", CurrentOwnedArray->GetAddress().GetGlobalStartPosition());
ChunkAddress = CurrentChunkedArray->GetChunk(ChunkAddress, position - CurrentOwnedArray->GetAddress().GetGlobalStartPosition());
AFL_VERIFY(ChunkAddress);
ChunkStartPosition = CurrentOwnedArray->GetAddress().GetGlobalStartPosition() + ChunkAddress->GetAddress().GetGlobalStartPosition();
ChunkFinishPosition =
Expand All @@ -83,7 +85,7 @@ class TSparsedMerger: public IColumnMerger {
return {};
}
if (ChunkFinishPosition <= currentIndex) {
InitArrays(currentGlobalPosition);
InitArrays(currentIndex);
continue;
}
for (; currentIndex < ChunkFinishPosition; ++currentIndex) {
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/formats/arrow/accessor/abstract/accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ std::shared_ptr<arrow::ChunkedArray> IChunkedArray::Slice(const ui32 offset, con

NKikimr::NArrow::NAccessor::IChunkedArray::TFullDataAddress IChunkedArray::GetChunk(
const std::optional<TAddressChain>& chunkCurrent, const ui64 position) const {
AFL_VERIFY(position < GetRecordsCount());
AFL_VERIFY(position < GetRecordsCount())("pos", position)("records", GetRecordsCount())("current", chunkCurrent ? chunkCurrent->DebugString() : Default<TString>());
std::optional<TCommonChunkAddress> address;

if (IsDataOwner()) {
Expand Down
9 changes: 7 additions & 2 deletions ydb/library/formats/arrow/accessor/abstract/accessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,13 @@ class IChunkedArray {
}

TString DebugString() const {
return TStringBuilder() << "start=" << GlobalStartPosition << ";finish=" << GlobalFinishPosition
<< ";addresses_count=" << Addresses.size() << ";";
TStringBuilder sb;
sb << "start=" << GlobalStartPosition << ";finish=" << GlobalFinishPosition
<< ";addresses_count=" << Addresses.size() << ";";
for (auto&& i : Addresses) {
sb << "addresses=" << i.DebugString() << ";";
}
return sb;
}
};

Expand Down

0 comments on commit 456c37b

Please sign in to comment.