12#ifndef _SWATDB_HASHJOIN_H_
13#define _SWATDB_HASHJOIN_H_
131 std::uint32_t result_num;
Definition blockheapfilescanner.h:35
~HashJoin()
Destructor for hashjoin class.
HashJoin(FileId outer_id, FileId inner_id, FileId result_id, std::vector< FieldId > outer_fields, std::vector< FieldId > inner_fields, std::uint32_t num_buckets, std::string temp_path, Catalog *catalog, BufferManager *buf_mgr, FileManager *file_mgr)
Constructor for the join operater using a hash join algorithm. Sets up the state for a single join op...
std::vector< std::pair< HeapPage *, PageId > > hash_table
Definition hashjoin.h:121
std::vector< HeapFile * > outer_partitions
Definition hashjoin.h:105
std::uint32_t hash1(Record *rec, bool is_outer)
Performs the first hash function on the inputted record.
RecordId _part1(Record *record, bool is_outer, BlockHeapFileScanner *scanner)
Performs the main looping functionality for first hash.
void _secondHash()
Performs the second hashing of each relation for the second step of hash join.
std::vector< HeapFile * > inner_partitions
Definition hashjoin.h:111
BufferManager * buf_mgr
Definition hashjoin.h:94
void cleanup()
Function that cleans up state and deletes all allocated memory. It will be called once by one thread ...
void _createTempFiles()
Performs the set up phase of hash join, creating temporary hashed files to be used by hash join algor...
void runOperation()
Performs the join operation using the hash join alogrithm.
FileManager * file_mgr
Definition hashjoin.h:99
void _firstHash(bool is_outer)
Performs the initial hashing of each relation for the first step of hash join.
std::string temp_path
Holds the path to which the temp files should be saved. "/local/" is recommended for performance.
Definition hashjoin.h:127
std::uint32_t num_buckets
Definition hashjoin.h:116
Definition heapfilescanner.h:39
std::vector< FieldId > inner_fields
Definition join.h:83
std::vector< FieldId > outer_fields
Definition join.h:78
Definition relationfile.h:32
Definition swatdb_types.h:70
std::uint32_t FileId
Definition swatdb_types.h:33