Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cpp/velox/shuffle/ArrowShuffleDictionaryWriter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ arrow::Status ArrowShuffleDictionaryWriter::serialize(arrow::io::OutputStream* o
ARROW_RETURN_NOT_OK(out->Write(bitMap.data(), bitMapSize));

for (auto fieldIdx : dictionaryFields_) {
auto it = dictionaries_.find(fieldIdx);
GLUTEN_DCHECK(
dictionaries_.find(fieldIdx) != dictionaries_.end(),
it != dictionaries_.end(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLUTEN_DCHECK means the code only executes on debug compilation mode, so we don't need to add complexity for it. Only if the code logic has something wrong, the check mai fail.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jinchengchenghh This change makes sense as dictionaries_.erase(fieldIdx) also performs another lookup.

"Invalid dictionary field index: " + std::to_string(fieldIdx));

const auto& dictionary = dictionaries_[fieldIdx];
ARROW_RETURN_NOT_OK(dictionary->serialize(out));
ARROW_RETURN_NOT_OK(it->second->serialize(out));

dictionaries_.erase(fieldIdx);
dictionaries_.erase(it);
}

return arrow::Status::OK();
Expand Down
Loading