Turi Create  4.0
turi::join_impl::join_hash_table Class Reference

#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 ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ join_hash_table()

turi::join_impl::join_hash_table::join_hash_table ( std::vector< size_t >  hp)
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.

Member Function Documentation

◆ add_row()

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.

◆ get_matching_rows()

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.

◆ num_stored_rows()

size_t turi::join_impl::join_hash_table::num_stored_rows ( )

Prints stats about the hash table to the log.


The documentation for this class was generated from the following file: