MCPcopy Create free account
hub / github.com/apache/impala / InitHashTable

Method InitHashTable

be/src/exec/grouping-aggregator-partition.cc:83–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83Status GroupingAggregator::Partition::InitHashTable(bool* got_memory) {
84 DCHECK(aggregated_row_stream != nullptr);
85 DCHECK(hash_tbl == nullptr);
86 // We use the upper PARTITION_FANOUT num bits to pick the partition so only the
87 // remaining bits can be used for the hash table.
88 // TODO: we could switch to 64 bit hashes and then we don't need a max size.
89 // It might be reasonable to limit individual hash table size for other reasons
90 // though. Always start with small buffers.
91 hash_tbl.reset(HashTable::Create(parent->ht_allocator_.get(), false, 1, nullptr,
92 1L << (32 - NUM_PARTITIONING_BITS), PAGG_DEFAULT_HASH_TABLE_SZ));
93 // Please update the error message in CreateHashPartitions() if initial size of
94 // hash table changes.
95 Status status = hash_tbl->Init(got_memory);
96 if (!status.ok()) {
97 hash_tbl->Close();
98 hash_tbl.reset();
99 }
100 return status;
101}
102
103Status GroupingAggregator::Partition::SerializeStreamForSpilling() {
104 DCHECK(!parent->is_streaming_preagg_);

Callers 1

CreateHashPartitionsMethod · 0.80

Calls 6

CreateClass · 0.85
resetMethod · 0.65
getMethod · 0.65
InitMethod · 0.45
okMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected