MCPcopy Create free account
hub / github.com/bytedance/bolt / IOBufToRowVector

Function IOBufToRowVector

bolt/vector/VectorStream.cpp:274–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272}
273
274RowVectorPtr IOBufToRowVector(
275 const folly::IOBuf& ioBuf,
276 const RowTypePtr& outputType,
277 memory::MemoryPool& pool,
278 VectorSerde* serde,
279 const VectorSerde::Options* options) {
280 std::vector<ByteRange> ranges;
281 ranges.reserve(4);
282
283 for (const auto& range : ioBuf) {
284 ranges.emplace_back(ByteRange{
285 const_cast<uint8_t*>(range.data()), (int32_t)range.size(), 0});
286 }
287
288 auto byteStream = std::make_unique<ByteInputStream>(std::move(ranges));
289 RowVectorPtr outputVector;
290
291 // If not supplied, use the default one.
292 if (serde == nullptr) {
293 serde = getVectorSerde();
294 }
295 serde->deserialize(
296 byteStream.get(), &pool, outputType, &outputVector, options);
297 return outputVector;
298}
299
300} // namespace bytedance::bolt

Callers 6

TEST_PFunction · 0.85
TEST_PFunction · 0.85
runOnceArrowIOBufMethod · 0.85
runOncePrestoIOBufMethod · 0.85
applyRemoteMethod · 0.85
invokeFunctionMethod · 0.85

Calls 6

getVectorSerdeFunction · 0.85
reserveMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
deserializeMethod · 0.45
getMethod · 0.45

Tested by 4

TEST_PFunction · 0.68
TEST_PFunction · 0.68
runOnceArrowIOBufMethod · 0.68
runOncePrestoIOBufMethod · 0.68