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

Function writeScalarConstant

bolt/vector/VectorSaver.cpp:314–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312
313template <TypeKind kind>
314void writeScalarConstant(const BaseVector& vector, std::ostream& out) {
315 using T = typename TypeTraits<kind>::NativeType;
316
317 auto value = vector.as<ConstantVector<T>>()->valueAt(0);
318 out.write((const char*)&value, sizeof(T));
319
320 if constexpr (std::is_same_v<T, StringView>) {
321 if (!value.isInline()) {
322 write<int32_t>(value.size(), out);
323 out.write(value.data(), value.size());
324 }
325 }
326}
327
328void writeConstantVector(const BaseVector& vector, std::ostream& out) {
329 bool isNull = vector.isNullAt(0);

Callers

nothing calls this directly

Calls 5

isInlineMethod · 0.80
valueAtMethod · 0.45
writeMethod · 0.45
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected