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

Function readDecimalValues

bolt/serializers/PrestoSerializer.cpp:323–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323void readDecimalValues(
324 ByteInputStream* source,
325 vector_size_t size,
326 vector_size_t offset,
327 BufferPtr nulls,
328 vector_size_t nullCount,
329 BufferPtr values) {
330 auto rawValues = values->asMutable<int128_t>();
331 if (nullCount) {
332 int32_t toClear = offset;
333 bits::forEachSetBit(
334 nulls->as<uint64_t>(), offset, offset + size, [&](int32_t row) {
335 // Set the values between the last non-null and this to type default.
336 for (; toClear < row; ++toClear) {
337 rawValues[toClear] = 0;
338 }
339 rawValues[row] = readJavaDecimal(source);
340 toClear = row + 1;
341 });
342 } else {
343 for (int32_t row = 0; row < size; ++row) {
344 rawValues[offset + row] = readJavaDecimal(source);
345 }
346 }
347}
348
349vector_size_t readNulls(
350 ByteInputStream* source,

Callers 1

readFunction · 0.85

Calls 2

forEachSetBitFunction · 0.85
readJavaDecimalFunction · 0.85

Tested by

no test coverage detected