class xf::database::gqe::Table

#include "gqe_table.hpp"

Overview

column wrapper, column name and data pointer


Methods

Table

Table ()

construct of Table .

addCol

addCol overload (1)

void addCol (
    std::string _name,
    TypeEnum type_size,
    void* _ptr,
    int row_num
    )

provide pointer by user add it as one column into Table .

usage: tab.addCol(“o_orderkey”, TypeEnum::TypeInt32 , tab_o_col0, 10000);

Parameters:

_name column name
type_size column element type size
_ptr column buffer pointer
row_num row number

addCol overload (2)

void addCol (
    std::string _name,
    TypeEnum type_size,
    int row_num
    )

create pointer for one column and add it into Table .

usage: tab.addCol(“o_orderkey”, TypeEnum::TypeInt32 , 10000);

Parameters:

_name column name
type_size column element type size
row_num row number

addCol overload (3)

void addCol (
    std::string _name,
    TypeEnum type_size,
    std::vector <std::string> dat_list
    )

create one column with several sections by loading from data file.

usage: tab.addCol(“o_orderkey”, TypeEnum::TypeInt32 , {file1.dat,file2.dat});

Parameters:

_name column name
type_size column element type size
dat_list data file list

addCol overload (4)

void addCol (
    std::string _name,
    TypeEnum type_size,
    std::vector <struct ColPtr> ptr_pairs
    )

create one column with several sections by user’s provided pointers

usage: tab.addCol(“o_orderkey”, TypeEnum::TypeInt32 , {{ptr1,10000},{ptr2,20000}});

Parameters:

_name column name
type_size column element type size
ptr_pairs vector of (ptr,row_num) pairs

setRowNum

void setRowNum (int _num)

set row number.

Parameters:

_num row number

setSecRowNum

void setSecRowNum (int _num)

set section row number for one column.

Parameters:

_num section row number

getRowNum

size_t getRowNum () const

get row number.

Returns:

row number

getSecRowNum

size_t getSecRowNum (int sid) const

get section row number.

Returns:

section row number of input setction id

getColNum

size_t getColNum () const

get column num.

Returns:

column num.

getSecNum

size_t getSecNum () const

get section num.

Returns:

section num.

getColTypeSize

size_t getColTypeSize (int cid) const

get column data type size.

Returns:

date type size of input column id.

getColPointer

getColPointer overload (1)

char* getColPointer (
    int i,
    int _slice_num,
    int j = 0
    ) const

get buffer pointer.

when getColPointer(2,4,1), it means column 2 was divied into 4 sections, return the second part pointer

Parameters:

i column id
_slice_num divide column i into _slice_num parts
j get the j’th part pointer after dividing

Returns:

column buffer pointer

getColPointer overload (2)

char* getColPointer (int i) const

get column pointer.

Parameters:

i column id

Returns:

column pointer

setColNames

void setColNames (std::vector <std::string> col_names)

set col_names

Parameters:

col_name column name vector

getColNames

std::vector <std::string> getColNames ()

get col_names

Returns:

vector of column names

~Table

~Table ()

deconstruct of Table .

info

void info ()

print info for tab