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

Function extractComplexType

bolt/exec/RowToColumnVector.h:49–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48template <bool useRowNumbers>
49FOLLY_ALWAYS_INLINE void extractComplexType(
50 char** rows,
51 folly::Range<const vector_size_t*> rowNumbers,
52 int32_t numRows,
53 RowColumn column,
54 int32_t resultOffset,
55 const VectorPtr& result) {
56 auto nullByte = column.nullByte();
57 auto nullMask = column.nullMask();
58 auto offset = column.offset();
59
60 BOLT_DCHECK_LE(numRows + resultOffset, result->size());
61 for (int i = 0; i < numRows; ++i) {
62 const char* row;
63 if constexpr (useRowNumbers) {
64 auto rowNumber = rowNumbers[i];
65 row = rowNumber >= 0 ? rows[rowNumber] : nullptr;
66 } else {
67 row = rows[i];
68 }
69 auto resultIndex = resultOffset + i;
70 if (!row || RowContainer::isNullAt(row, nullByte, nullMask)) {
71 result->setNull(resultIndex, true);
72 } else {
73 auto sv = RowContainer::valueAt<std::string_view>(row, offset);
74 ByteRange range{
75 reinterpret_cast<uint8_t*>(const_cast<char*>(sv.data())),
76 static_cast<int32_t>(sv.size()),
77 0};
78 ByteInputStream stream(std::vector<ByteRange>{range});
79 ContainerRowSerde::deserialize(stream, resultIndex, result.get());
80 }
81 }
82}
83
84template <bool useRowNumbers, typename T>
85FOLLY_ALWAYS_INLINE void extractValuesWithNulls(

Callers

nothing calls this directly

Calls 9

isNullAtFunction · 0.50
deserializeFunction · 0.50
nullByteMethod · 0.45
nullMaskMethod · 0.45
offsetMethod · 0.45
sizeMethod · 0.45
setNullMethod · 0.45
dataMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected