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

Method analyze

bolt/exec/HashTable.cpp:1459–1492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1457
1458template <bool ignoreNullKeys>
1459bool HashTable<ignoreNullKeys>::analyze() {
1460 constexpr int32_t kHashBatchSize = 1024;
1461 // @lint-ignore CLANGTIDY
1462 char* groups[kHashBatchSize];
1463 RowContainerIterator iterator;
1464 int32_t numGroups;
1465 do {
1466 numGroups = rows_->listRows(&iterator, kHashBatchSize, groups);
1467 for (int32_t i = 0; i < hashers_.size(); ++i) {
1468 auto& hasher = hashers_[i];
1469 if (!hasher->isRange()) {
1470 // A range mode hasher does not know distincts, so need to
1471 // look. A distinct mode one does know the range. A hash join
1472 // build is always analyzed.
1473 continue;
1474 }
1475 uint64_t rangeSize;
1476 uint64_t distinctSize;
1477 hasher->cardinality(0, rangeSize, distinctSize);
1478 if (distinctSize == VectorHasher::kRangeTooLarge &&
1479 rangeSize == VectorHasher::kRangeTooLarge) {
1480 return false;
1481 }
1482 RowColumn column = rows_->columnAt(i);
1483 hasher->analyze(
1484 groups,
1485 numGroups,
1486 column.offset(),
1487 ignoreNullKeys ? 0 : column.nullByte(),
1488 ignoreNullKeys ? 0 : column.nullMask());
1489 }
1490 } while (numGroups > 0);
1491 return true;
1492}
1493
1494namespace {
1495// Multiplies a * b and produces uint64_t max to denote overflow. If

Callers 1

prepareJoinTableMethod · 0.45

Calls 8

isRangeMethod · 0.80
columnAtMethod · 0.80
listRowsMethod · 0.45
sizeMethod · 0.45
cardinalityMethod · 0.45
offsetMethod · 0.45
nullByteMethod · 0.45
nullMaskMethod · 0.45

Tested by

no test coverage detected