Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DataProvider::ColDesc Class Reference

#include <data-provider.h>

Collaboration diagram for DataProvider::ColDesc:

Public Member Functions

template<>
DataProvider::ColDesc Create (const bool &min, const bool &max, DataGen gen)
 
template<>
DataProvider::ColDesc Create (const int8_t &min, const int8_t &max, DataGen gen)
 
template<>
DataProvider::ColDesc Create (const int16_t &min, const int16_t &max, DataGen gen)
 
template<>
DataProvider::ColDesc Create (const int32_t &min, const int32_t &max, DataGen gen)
 
template<>
DataProvider::ColDesc Create (const int64_t &min, const int64_t &max, DataGen gen)
 
template<>
DataProvider::ColDesc Create (const float &min, const float &max, DataGen gen)
 
template<>
DataProvider::ColDesc Create (const double &min, const double &max, DataGen gen)
 

Static Public Member Functions

template<typename T >
static ColDesc Create (const T &min, const T &max, DataGen gen=UNIFORM_RANDOM)
 Create a column desc with min/max range and the data gen type. More...
 

Private Member Functions

template<typename T >
Generate (double d, int i) const
 
 ColDesc (impala::PrimitiveType type, int bytes)
 
template<typename T >
Generate (double d, int i, T min, T max) const
 Default generator - used for int and float types. More...
 
template<>
bool Generate (double d, int i) const
 
template<>
int8_t Generate (double d, int i) const
 
template<>
int16_t Generate (double d, int i) const
 
template<>
int32_t Generate (double d, int i) const
 
template<>
int64_t Generate (double d, int i) const
 
template<>
float Generate (double d, int i) const
 
template<>
double Generate (double d, int i) const
 

Private Attributes

impala::PrimitiveType type
 
Value min
 
Value max
 
DataGen gen_type
 
int bytes
 

Friends

class DataProvider
 

Detailed Description

Definition at line 54 of file data-provider.h.

Constructor & Destructor Documentation

DataProvider::ColDesc::ColDesc ( impala::PrimitiveType  type,
int  bytes 
)
inlineprivate

Definition at line 69 of file data-provider.h.

References bytes, and type.

Member Function Documentation

template<typename T >
static ColDesc DataProvider::ColDesc::Create ( const T &  min,
const T &  max,
DataGen  gen = UNIFORM_RANDOM 
)
static

Create a column desc with min/max range and the data gen type.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const bool min,
const bool max,
DataGen  gen 
)
inline

Definition at line 135 of file data-provider.h.

References DataProvider::Value::b, gen_type, max, min, and impala::TYPE_BOOLEAN.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const int8_t &  min,
const int8_t &  max,
DataGen  gen 
)
inline

Definition at line 144 of file data-provider.h.

References gen_type, DataProvider::Value::int8, max, min, and impala::TYPE_TINYINT.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const int16_t &  min,
const int16_t &  max,
DataGen  gen 
)
inline

Definition at line 153 of file data-provider.h.

References gen_type, DataProvider::Value::int16, max, min, and impala::TYPE_SMALLINT.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const int32_t &  min,
const int32_t &  max,
DataGen  gen 
)
inline

Definition at line 162 of file data-provider.h.

References gen_type, DataProvider::Value::int32, max, min, and impala::TYPE_INT.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const int64_t &  min,
const int64_t &  max,
DataGen  gen 
)
inline

Definition at line 171 of file data-provider.h.

References gen_type, DataProvider::Value::int64, max, min, and impala::TYPE_BIGINT.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const float &  min,
const float &  max,
DataGen  gen 
)
inline

Definition at line 180 of file data-provider.h.

References DataProvider::Value::f, gen_type, max, min, and impala::TYPE_FLOAT.

template<>
DataProvider::ColDesc DataProvider::ColDesc::Create ( const double &  min,
const double &  max,
DataGen  gen 
)
inline

Definition at line 189 of file data-provider.h.

References DataProvider::Value::d, gen_type, max, min, and impala::TYPE_DOUBLE.

template<typename T >
T DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
private

Generates a column value between [min,max) for this column. d is a random value between [0,1] and i is the row index.

Referenced by DataProvider::NextBatch().

template<typename T >
T DataProvider::ColDesc::Generate ( double  d,
int  i,
min,
max 
) const
inlineprivate

Default generator - used for int and float types.

Definition at line 76 of file data-provider.h.

References gen_type, min, DataProvider::SEQUENTIAL, and DataProvider::UNIFORM_RANDOM.

template<>
bool DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 208 of file data-provider.h.

References DataProvider::SEQUENTIAL, and DataProvider::UNIFORM_RANDOM.

template<>
int8_t DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 217 of file data-provider.h.

template<>
int16_t DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 220 of file data-provider.h.

template<>
int32_t DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 223 of file data-provider.h.

template<>
int64_t DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 226 of file data-provider.h.

template<>
float DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 229 of file data-provider.h.

template<>
double DataProvider::ColDesc::Generate ( double  d,
int  i 
) const
inlineprivate

Definition at line 232 of file data-provider.h.

Friends And Related Function Documentation

friend class DataProvider
friend

Definition at line 61 of file data-provider.h.

Member Data Documentation

int DataProvider::ColDesc::bytes
private

Definition at line 89 of file data-provider.h.

Referenced by ColDesc(), and DataProvider::NextBatch().

DataGen DataProvider::ColDesc::gen_type
private

Definition at line 88 of file data-provider.h.

Referenced by Create(), and Generate().

Value DataProvider::ColDesc::max
private

Definition at line 87 of file data-provider.h.

Referenced by Create(), and DataProvider::NextBatch().

Value DataProvider::ColDesc::min
private

Definition at line 87 of file data-provider.h.

Referenced by Create(), Generate(), and DataProvider::NextBatch().

impala::PrimitiveType DataProvider::ColDesc::type
private

Definition at line 86 of file data-provider.h.

Referenced by ColDesc(), and DataProvider::NextBatch().


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