Skip to content

Commit

Permalink
Use ByteOutputStream::size() in RowContainer::storeComplexType (faceb…
Browse files Browse the repository at this point in the history
…ookincubator#10055)

Summary:
PR facebookincubator#7520 fixed the semantics of ByteOutputStream::size() to return the length of
the data written to the stream. Hence, we can use it directly in
`RowContainer::storeComplexType`.

Pull Request resolved: facebookincubator#10055

Reviewed By: kgpai

Differential Revision: D58195597

Pulled By: kevinwilfong

fbshipit-source-id: f7034ddb93a2d6f7e6e0640ffff65d83bb84f06d
  • Loading branch information
wypb authored and facebook-github-bot committed Jun 5, 2024
1 parent 3832dfc commit 20e4807
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions velox/exec/RowContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,14 +773,7 @@ void RowContainer::storeComplexType(

valueAt<std::string_view>(row, offset) = std::string_view(
reinterpret_cast<char*>(position.position), stream.size());

// TODO Fix ByteOutputStream::size() API. @oerling is looking into that.
// Fix the 'size' of the std::string_view.
// stream.size() is the capacity
// stream.size() - stream.remainingSize() is the size of the data + size of
// 'next' links (8 bytes per link).
auto readStream = prepareRead(row, offset);
const auto size = readStream.size();
const auto size = stream.size();
valueAt<std::string_view>(row, offset) =
std::string_view(reinterpret_cast<char*>(position.position), size);
}
Expand Down

0 comments on commit 20e4807

Please sign in to comment.