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

Function readJavaDecimal

bolt/serializers/PrestoSerializer.cpp:310–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310int128_t readJavaDecimal(ByteInputStream* source) {
311 // ByteInputStream does not support reading int128_t values.
312 auto low = source->read<int64_t>();
313 auto high = source->read<int64_t>();
314 // 'high' is in signed magnitude representation.
315 if (high < 0) {
316 // Remove the sign bit before building the int128 value.
317 // Negate the value.
318 return -1 * HugeInt::build(high & DecimalUtil::kInt64Mask, low);
319 }
320 return HugeInt::build(high, low);
321}
322
323void readDecimalValues(
324 ByteInputStream* source,

Callers 1

readDecimalValuesFunction · 0.85

Calls 1

buildFunction · 0.85

Tested by

no test coverage detected