Turi Create
4.0
|
#include <core/storage/sframe_data/join_impl.hpp>
Public Member Functions | |
join_hash_table (std::vector< size_t > hp) | |
bool | add_row (const std::vector< flexible_type > &row) |
const value_type & | get_matching_rows (const std::vector< flexible_type > &row, const std::vector< size_t > &hash_positions, bool mark_match=true) |
size_t | num_stored_rows () |
This class is the keeper of an in-memory hash table for use in a join algorithm. Its methods facilatate hashing by given join keys by taking a vector of positions these keys are in a row.
NOTE:Could be templated for hash_type, row_type, but I don't see a need now.
Definition at line 45 of file join_impl.hpp.
|
inline |
Constructor. Takes a vector of hash positions, which are the column numbers in each row that represent the values the join is on (or the join keys). These hash positions are for the frame that each row is added from.
Definition at line 54 of file join_impl.hpp.
bool turi::join_impl::join_hash_table::add_row | ( | const std::vector< flexible_type > & | row | ) |
Add a row to the hash table. Each row must be from the same frame, or else join results will not make sense.
const value_type& turi::join_impl::join_hash_table::get_matching_rows | ( | const std::vector< flexible_type > & | row, |
const std::vector< size_t > & | hash_positions, | ||
bool | mark_match = true |
||
) |
Returns all rows whose join keys match the given row's join keys.
The return object is a hash_join_row_t, a structure containing a list of rows and whether this join key was "matched" or not. An optional argument marks all of the matching rows as "matched", which is usually used for completing a left join, in deciding which rows need to be joined with NULL values and emitted into the result set.
size_t turi::join_impl::join_hash_table::num_stored_rows | ( | ) |
Prints stats about the hash table to the log.