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

Function readValues

bolt/serializers/PrestoSerializer.cpp:194–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192
193template <typename T>
194void readValues(
195 ByteInputStream* source,
196 vector_size_t size,
197 vector_size_t offset,
198 BufferPtr nulls,
199 vector_size_t nullCount,
200 BufferPtr values) {
201 if (nullCount) {
202 auto rawValues = values->asMutable<T>();
203 int32_t toClear = offset;
204 bits::forEachSetBit(
205 nulls->as<uint64_t>(), offset, offset + size, [&](int32_t row) {
206 // Set the values between the last non-null and this to type default.
207 for (; toClear < row; ++toClear) {
208 rawValues[toClear] = T();
209 }
210 rawValues[row] = source->read<T>();
211 toClear = row + 1;
212 });
213 } else {
214 source->readBytes(
215 values->asMutable<uint8_t>() + offset * sizeof(T), size * sizeof(T));
216 }
217}
218
219template <>
220void readValues<bool>(

Callers

nothing calls this directly

Calls 2

forEachSetBitFunction · 0.85
readBytesMethod · 0.45

Tested by

no test coverage detected