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

Function deserializeString

bolt/exec/ContainerRowSerde.cpp:472–491  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470}
471
472void deserializeString(
473 ByteInputStream& in,
474 vector_size_t index,
475 BaseVector& result,
476 bool exactSize) {
477 BOLT_CHECK_EQ(result.encoding(), VectorEncoding::Simple::FLAT);
478 auto values = result.asUnchecked<FlatVector<StringView>>();
479 auto size = in.read<int32_t>();
480 if (StringView::isInline(size)) {
481 char start[StringView::kInlineSize];
482 in.readBytes(start, size);
483 values->setNoCopy(index, StringView(start, size));
484 } else {
485 auto buffer = values->getBufferWithSpace(size, exactSize);
486 auto start = buffer->asMutable<char>() + buffer->size();
487 in.readBytes(start, size);
488 buffer->setSize(buffer->size() + size);
489 values->setNoCopy(index, StringView(start, size));
490 }
491}
492
493template <>
494void deserializeOne<TypeKind::VARCHAR>(

Callers 3

deserializeVariantFunction · 0.70
VARCHAR>Method · 0.70
VARBINARY>Method · 0.70

Calls 7

StringViewClass · 0.50
encodingMethod · 0.45
readBytesMethod · 0.45
setNoCopyMethod · 0.45
getBufferWithSpaceMethod · 0.45
sizeMethod · 0.45
setSizeMethod · 0.45

Tested by

no test coverage detected