Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
stl-like iterator interface. More...
#include <hash-table.h>
Public Member Functions | |
Iterator () | |
void IR_ALWAYS_INLINE | Next () |
Iterates to the next element. It should be called only if !AtEnd(). More... | |
void IR_ALWAYS_INLINE | NextDuplicate () |
void | NextUnmatched () |
TupleRow * | GetRow () const |
Tuple * | GetTuple () const |
void | SetMatched () |
bool | IsMatched () const |
void | SetAtEnd () |
Resets everything but the pointer to the hash table. More... | |
bool | AtEnd () const |
Returns true if this iterator is at the end, i.e. GetRow() cannot be called. More... | |
Private Member Functions | |
Iterator (HashTable *table, TupleRow *row, int bucket_idx, DuplicateNode *node, uint32_t hash) | |
Private Attributes | |
HashTable * | table_ |
TupleRow * | row_ |
int64_t | bucket_idx_ |
DuplicateNode * | node_ |
Pointer to the current duplicate node. More... | |
Static Private Attributes | |
static const int64_t | BUCKET_NOT_FOUND = -1 |
Bucket index value when probe is not successful. More... | |
Friends | |
class | HashTable |
stl-like iterator interface.
Definition at line 450 of file hash-table.h.
|
inline |
Definition at line 457 of file hash-table.h.
|
inlineprivate |
Definition at line 497 of file hash-table.h.
|
inline |
Returns true if this iterator is at the end, i.e. GetRow() cannot be called.
Definition at line 492 of file hash-table.h.
References bucket_idx_, and BUCKET_NOT_FOUND.
Referenced by impala::PartitionedAggregationNode::CleanupHashTbl(), impala::HashTableTest::FullScan(), impala::PartitionedAggregationNode::GetNext(), GetRow(), impala::HashTableTest::GrowTableTest(), impala::HashTableTest::InsertFullTest(), impala::PartitionedHashJoinNode::OutputUnmatchedBuild(), impala::HashTableTest::ProbeTest(), impala::PartitionedAggregationNode::ProcessBatch(), impala::PartitionedHashJoinNode::ProcessProbeBatch(), impala::HashTable::ResizeBuckets(), and impala::PartitionedAggregationNode::Partition::Spill().
|
inline |
Return the current row or tuple. Callers must check the iterator is not AtEnd() before calling them. The returned row is owned by the iterator and valid until the next call to GetRow(). It is safe to advance the iterator.
Definition at line 230 of file hash-table.inline.h.
References AtEnd(), bucket_idx_, impala::HashTable::Bucket::bucketData, impala::HashTable::buckets_, impala::HashTable::GetRow(), impala::HashTable::Bucket::hasDuplicates, impala::HashTable::DuplicateNode::htdata, impala::HashTable::Bucket::htdata, node_, row_, table_, and UNLIKELY.
Referenced by impala::HashTableTest::FullScan(), impala::HashTableTest::GrowTableTest(), impala::PartitionedHashJoinNode::OutputUnmatchedBuild(), impala::HashTableTest::ProbeTest(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
|
inline |
Definition at line 243 of file hash-table.inline.h.
References impala::HashTable::Bucket::bucketData, impala::HashTable::Bucket::hasDuplicates, impala::HashTable::Bucket::htdata, impala::HashTable::HtData::tuple, and UNLIKELY.
Referenced by impala::PartitionedAggregationNode::CleanupHashTbl(), impala::PartitionedAggregationNode::GetNext(), impala::PartitionedAggregationNode::ProcessBatch(), and impala::PartitionedAggregationNode::Partition::Spill().
|
inline |
Returns the 'matched' flag of the current Bucket or DuplicateNode, depending on whether the bucket has duplicates or not. It should be called only if !AtEnd().
Definition at line 269 of file hash-table.inline.h.
References impala::HashTable::Bucket::hasDuplicates, and impala::HashTable::Bucket::matched.
Referenced by impala::PartitionedHashJoinNode::OutputUnmatchedBuild(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
|
inline |
Iterates to the next element. It should be called only if !AtEnd().
Definition at line 283 of file hash-table.inline.h.
Referenced by impala::PartitionedAggregationNode::CleanupHashTbl(), impala::HashTableTest::FullScan(), impala::PartitionedAggregationNode::GetNext(), impala::HashTableTest::ProbeTest(), and impala::PartitionedAggregationNode::Partition::Spill().
|
inline |
Iterates to the next duplicate node. If the bucket does not have duplicates or when it reaches the last duplicate node, then it moves the Iterator to AtEnd(). Used when we want to iterate over all the duplicate nodes bypassing the Next() interface (e.g. in semi/outer joins without other_join_conjuncts, in order to iterate over all nodes of an unmatched bucket).
Definition at line 292 of file hash-table.inline.h.
Referenced by impala::PartitionedHashJoinNode::ProcessProbeBatch().
|
inline |
Iterates to the next element that does not have its matched flag set. Used in right-outer and full-outer joins.
Definition at line 302 of file hash-table.inline.h.
References BUCKET_NOT_FOUND, impala::HashTable::Bucket::hasDuplicates, and impala::HashTable::Bucket::matched.
Referenced by impala::PartitionedHashJoinNode::OutputUnmatchedBuild().
|
inline |
Resets everything but the pointer to the hash table.
Definition at line 278 of file hash-table.inline.h.
Referenced by impala::PartitionedHashJoinNode::ProcessProbeBatch(), and impala::PartitionedHashJoinNode::ResetForProbe().
|
inline |
Sets as matched the Bucket or DuplicateNode currently pointed by the iterator, depending on whether the bucket has duplicates or not. The iterator cannot be AtEnd().
Definition at line 256 of file hash-table.inline.h.
References impala::HashTable::Bucket::hasDuplicates, and impala::HashTable::Bucket::matched.
Referenced by impala::PartitionedHashJoinNode::OutputUnmatchedBuild(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
|
friend |
Definition at line 495 of file hash-table.h.
|
private |
Current bucket idx. TODO: Use uint32_t?
Definition at line 510 of file hash-table.h.
|
staticprivate |
Bucket index value when probe is not successful.
Definition at line 453 of file hash-table.h.
Referenced by AtEnd(), impala::HashTable::Begin(), impala::HashTable::FirstUnmatched(), impala::HashTable::InsertInternal(), impala::HashTable::NextFilledBucket(), NextUnmatched(), impala::HashTable::Probe(), and impala::HashTable::ResizeBuckets().
|
private |
Pointer to the current duplicate node.
Definition at line 513 of file hash-table.h.
Referenced by GetRow().
|
private |
Definition at line 506 of file hash-table.h.
Referenced by GetRow().
|
private |
Definition at line 505 of file hash-table.h.
Referenced by GetRow().