class xf::database::gqe::AggrConfig

#include "gqe_aggr_config.hpp"

Overview

// structs

struct hashGrpInfo

Methods

AggrConfig

AggrConfig (
    Table tab_in,
    std::vector <EvaluationInfo> evals_info,
    std::string filter_str,
    std::string group_keys_str,
    std::string output_str,
    bool avg_to_sum_ = false
    )

construct of AggrConfig .

The class generate aggregation configure bits by column names,

Input filter_str like “19940101<=o_orderdate && o_orderdate<19950101”, o_orderdate and o_orderdate must be exsisted colunm names in input table when no filter conditions, input “”

Input evaluation information as a struct EvaluationInfo , creata a valid Evaluation struct using initializer list, e.g. {“l_extendedprice * (-l_discount+c2) / 100”, {0, 100}} EvaluationInfo has two members: evaluation string and evaluation constants. In the evaluation string, you can input a final division calculation. Divisor only supports: 10,100,1000,10000 In the evaluation constants, input a constant for each column, if no constant, like “l_extendedprice” above, input zero.

Input Group keys in a string, like “group_key0, group_key1”, use comma as seperator

Output strings are like “c0=tab_in_col1, c1=tab_in_col2”, when contains several columns, use comma as seperator Usage:

AggrConfig aggr_config(tab_in,
            {{"l_extendedprice * (-l_discount+c2) / 100", {0, 100}}},
            "l_shipdate<=19980902",
            "l_returnflag,l_linestatus",
            "c0=l_returnflag, c1=l_linestatus,c2=sum(eval0),c3=sum(eval1)");

Parameters:

tab_in input table
evals_info Evalutaion information
filter_str filter condition
group_keys_str group keys
output_str output list, output1 = tab_a_col1
avg_to_sum_ if auto fix the avg config

getScanList

std::vector <int8_t> getScanList () const

software shuffle list.

Returns:

software shuffle array to adjust the kernel input

getPartList

std::vector <int8_t> getPartList () const

software shuffle list.

Returns:

software shuffle array to adjust the kernel input when using partition kernel

getWriteFlag

std::vector <bool> getWriteFlag () const

Write out flags.

Returns:

the write flags for each column, 0-invalid 1-valid

getPartConfigBits

ap_uint <512>* getPartConfigBits () const

return partition config bits.

Returns:

partition config bits

getAggrConfigBits

ap_uint <32>* getAggrConfigBits () const

return aggregation config bits.

Returns:

aggregation config bits

getResults

std::vector <int> getResults (int i)

return merge info for each output (32bits impl).

Returns:

return merge info for column i

getOutputColNum

int getOutputColNum () const

return output column number.

Returns:

return output column number

getGrpKeyNum

int getGrpKeyNum () const

return group key number.

Returns:

return group key number