| 66 | |
| 67 | template <bool ignoreNullKeys> |
| 68 | HashTable<ignoreNullKeys>::HashTable( |
| 69 | std::vector<std::unique_ptr<VectorHasher>>&& hashers, |
| 70 | const std::vector<Accumulator>& accumulators, |
| 71 | const std::vector<TypePtr>& dependentTypes, |
| 72 | bool allowDuplicates, |
| 73 | bool isJoinBuild, |
| 74 | bool hasProbedFlag, |
| 75 | HashMode mode, |
| 76 | uint32_t minTableSizeForParallelJoinBuild, |
| 77 | memory::MemoryPool* pool, |
| 78 | const std::shared_ptr<bolt::HashStringAllocator>& stringArena, |
| 79 | bool enableJit, |
| 80 | bool hybridMode) |
| 81 | : BaseHashTable(std::move(hashers)), |
| 82 | minTableSizeForParallelJoinBuild_(minTableSizeForParallelJoinBuild), |
| 83 | isJoinBuild_(isJoinBuild), |
| 84 | joinBuildNoDuplicates_(!allowDuplicates), |
| 85 | hashMode_(mode), |
| 86 | enableJit_(enableJit) { |
| 87 | std::vector<TypePtr> keys; |
| 88 | for (auto& hasher : hashers_) { |
| 89 | keys.push_back(hasher->type()); |
| 90 | if (!VectorHasher::typeKindSupportsValueIds(hasher->typeKind())) { |
| 91 | hashMode_ = HashMode::kHash; |
| 92 | } |
| 93 | } |
| 94 | if (hybridMode) { |
| 95 | std::vector<TypePtr> rowIdType = {BIGINT()}; |
| 96 | rows_ = std::make_unique<RowContainer>( |
| 97 | keys, |
| 98 | !ignoreNullKeys, |
| 99 | accumulators, |
| 100 | rowIdType, |
| 101 | allowDuplicates, |
| 102 | isJoinBuild, |
| 103 | hasProbedFlag, |
| 104 | hashMode_ != HashMode::kHash, |
| 105 | false /*useListRowIndex*/, |
| 106 | pool); |
| 107 | hybridData_ = |
| 108 | std::make_unique<HybridContainer>(keys, dependentTypes, rows_.get()); |
| 109 | } else { |
| 110 | rows_ = std::make_unique<RowContainer>( |
| 111 | keys, |
| 112 | !ignoreNullKeys, |
| 113 | accumulators, |
| 114 | dependentTypes, |
| 115 | allowDuplicates, |
| 116 | isJoinBuild, |
| 117 | hasProbedFlag, |
| 118 | hashMode_ != HashMode::kHash, |
| 119 | false /*useListRowIndex*/, |
| 120 | pool, |
| 121 | stringArena); |
| 122 | } |
| 123 | nextOffset_ = rows_->nextOffset(); |
| 124 | #ifdef ENABLE_BOLT_JIT // generate JIT lazily? |
| 125 | if (enableJit_) { |
nothing calls this directly
no test coverage detected