class xf::database::gqe::Joiner¶
#include "gqe_join.hpp"
Methods¶
Joiner¶
Joiner (FpgaInit& obj)
constructor of Joiner .
Passing FpgaInit obj to Joiner class. Splitting FpgaInit (OpenCL context, program, commandqueue, host/device buffers creation/allocation etc.) and Joiner Init, guaranteens OpenCL stuff are not released after each join call. So the joiner may launch multi-times.
Parameters:
obj | the FpgaInit instance. |
run¶
ErrCode run ( Table& tab_a, std::string filter_a, Table& tab_b, std::string filter_b, std::string join_str, Table& tab_c, std::string output_str, int join_type = INNER_JOIN, JoinStrategyBase* strategyimp = nullptr )
Run join with the input arguments defined strategy, which includes.
- solution: the join solution (direct-join or partation-join)
- sec_o: left table sec number
- sec_l: right table sec number
- slice_num: the slice number that used in probe
- log_part, the partition number of left/right table
- coef_exp_partO: the expansion coefficient of table O result buffer size / input buffer size, this param affects the output buffer size, but not the perf
- coef_exp_partL: the expansion coefficient of table L result buffer size / input buffer size, this param affects the output buffer size, but not the perf
- coef_exp_join: the expansion coefficient of result buffer size / input buffer size, this param affects the output buffer size, but not the perf
Usage:
auto smanual = new gqe::JoinStrategyManualSet(solution, sec_o, sec_l, slice_num, log_part, coef_exp_partO,
coef_exp_partL, coef_exp_join);
ErrCode err = bigjoin.run(
tab_o, "o_rowid > 0",
tab_l, "",
"o_orderkey = l_orderkey",
tab_c, "c1=l_orderkey, c2=o_rowid, c3=l_rowid",
gqe::INNER_JOIN,
smanual);
delete smanual;
Table tab_o filter condition like “o_rowid > 0”, o_rowid is the col name of tab_o when no filter conditions, given empty fitler condition “”
The join condition like “left_join_key_0=right_join_key_0” when dual key join is enabled, using comma as the seperator in join condition, e.g. “left_join_key_0=right_join_key_0,left_join_key_1=right_join_key_1”
Output strings are like “output_c0 = tab_a_col/tab_b_col”, when several columns are output, using comma as the seperator
Parameters:
tab_a | left table |
filter_a | filter condition of left table |
tab_b | right table |
filter_b | filter condition of right table |
join_str | join condition(s) |
tab_c | result table |
output_str | output columns |
join_type | INNER_JOIN(default) | SEMI_JOIN | ANTI_JOIN. |
strategyimp | pointer to an object of JoinStrategyBase or its derived type. |