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

Function readLosslessTimestampValues

bolt/serializers/PrestoSerializer.cpp:284–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void readLosslessTimestampValues(
285 ByteInputStream* source,
286 vector_size_t size,
287 vector_size_t offset,
288 BufferPtr nulls,
289 vector_size_t nullCount,
290 BufferPtr values) {
291 auto rawValues = values->asMutable<Timestamp>();
292 if (nullCount > 0) {
293 int32_t toClear = offset;
294 bits::forEachSetBit(
295 nulls->as<uint64_t>(), offset, offset + size, [&](int32_t row) {
296 // Set the values between the last non-null and this to type default.
297 for (; toClear < row; ++toClear) {
298 rawValues[toClear] = Timestamp();
299 }
300 rawValues[row] = readLosslessTimestamp(source);
301 toClear = row + 1;
302 });
303 } else {
304 for (int32_t row = offset; row < offset + size; ++row) {
305 rawValues[row] = readLosslessTimestamp(source);
306 }
307 }
308}
309
310int128_t readJavaDecimal(ByteInputStream* source) {
311 // ByteInputStream does not support reading int128_t values.

Callers 1

readFunction · 0.85

Calls 3

forEachSetBitFunction · 0.85
readLosslessTimestampFunction · 0.85
TimestampClass · 0.50

Tested by

no test coverage detected