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

Method appendLengths

bolt/serializers/PrestoSerializer.cpp:1432–1453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1430 // for non-nulls in rows.
1431 template <typename LengthFunc>
1432 void appendLengths(
1433 const uint64_t* nulls,
1434 folly::Range<const vector_size_t*> rows,
1435 int32_t numNonNull,
1436 LengthFunc lengthFunc) {
1437 const auto numRows = rows.size();
1438 if (nulls == nullptr) {
1439 appendNonNull(numRows);
1440 for (auto i = 0; i < numRows; ++i) {
1441 appendLength(lengthFunc(rows[i]));
1442 }
1443 } else {
1444 appendNulls(nulls, 0, numRows, numNonNull);
1445 for (auto i = 0; i < numRows; ++i) {
1446 if (bits::isBitSet(nulls, i)) {
1447 appendLength(lengthFunc(rows[i]));
1448 } else {
1449 appendLength(0);
1450 }
1451 }
1452 }
1453 }
1454
1455 template <typename T>
1456 void append(folly::Range<const T*> values) {

Callers 3

rowsToRangesFunction · 0.80
appendStringsFunction · 0.80
serializeRowVectorFunction · 0.80

Calls 3

appendNonNullFunction · 0.85
isBitSetFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected