OmniSciDB  72180abbfe
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ChunkMetadata Struct Reference

#include <ChunkMetadata.h>

+ Collaboration diagram for ChunkMetadata:

Public Member Functions

 ChunkMetadata (const SQLTypeInfo &sql_type, const size_t num_bytes, const size_t num_elements, const ChunkStats &chunk_stats)
 
 ChunkMetadata ()
 
template<typename T >
void fillChunkStats (const T min, const T max, const bool has_nulls)
 
void fillChunkStats (const Datum min, const Datum max, const bool has_nulls)
 
bool operator== (const ChunkMetadata &that) const
 

Public Attributes

SQLTypeInfo sqlType
 
size_t numBytes
 
size_t numElements
 
ChunkStats chunkStats
 

Detailed Description

Definition at line 31 of file ChunkMetadata.h.

Constructor & Destructor Documentation

ChunkMetadata::ChunkMetadata ( const SQLTypeInfo sql_type,
const size_t  num_bytes,
const size_t  num_elements,
const ChunkStats chunk_stats 
)
inline

Definition at line 37 of file ChunkMetadata.h.

41  : sqlType(sql_type)
42  , numBytes(num_bytes)
43  , numElements(num_elements)
44  , chunkStats(chunk_stats) {}
ChunkStats chunkStats
Definition: ChunkMetadata.h:35
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:32
size_t numElements
Definition: ChunkMetadata.h:34
ChunkMetadata::ChunkMetadata ( )
inline

Definition at line 46 of file ChunkMetadata.h.

46 {}

Member Function Documentation

template<typename T >
void ChunkMetadata::fillChunkStats ( const T  min,
const T  max,
const bool  has_nulls 
)
inline

Definition at line 49 of file ChunkMetadata.h.

References Datum::bigintval, chunkStats, Datum::doubleval, Datum::floatval, SQLTypeInfo::get_compression(), SQLTypeInfo::get_type(), ChunkStats::has_nulls, Datum::intval, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kENCODING_DICT, kFLOAT, kINT, kNUMERIC, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, ChunkStats::max, ChunkStats::min, Datum::smallintval, sqlType, and Datum::tinyintval.

Referenced by anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results().

49  {
50  chunkStats.has_nulls = has_nulls;
51  switch (sqlType.get_type()) {
52  case kBOOLEAN: {
55  break;
56  }
57  case kTINYINT: {
60  break;
61  }
62  case kSMALLINT: {
65  break;
66  }
67  case kINT: {
68  chunkStats.min.intval = min;
69  chunkStats.max.intval = max;
70  break;
71  }
72  case kBIGINT:
73  case kNUMERIC:
74  case kDECIMAL: {
75  chunkStats.min.bigintval = min;
76  chunkStats.max.bigintval = max;
77  break;
78  }
79  case kTIME:
80  case kTIMESTAMP:
81  case kDATE: {
82  chunkStats.min.bigintval = min;
83  chunkStats.max.bigintval = max;
84  break;
85  }
86  case kFLOAT: {
87  chunkStats.min.floatval = min;
88  chunkStats.max.floatval = max;
89  break;
90  }
91  case kDOUBLE: {
92  chunkStats.min.doubleval = min;
93  chunkStats.max.doubleval = max;
94  break;
95  }
96  case kVARCHAR:
97  case kCHAR:
98  case kTEXT:
100  chunkStats.min.intval = min;
101  chunkStats.max.intval = max;
102  }
103  break;
104  default: {
105  break;
106  }
107  }
108  }
int8_t tinyintval
Definition: sqltypes.h:133
Definition: sqltypes.h:50
bool has_nulls
Definition: ChunkMetadata.h:28
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:257
int32_t intval
Definition: sqltypes.h:135
ChunkStats chunkStats
Definition: ChunkMetadata.h:35
float floatval
Definition: sqltypes.h:137
int64_t bigintval
Definition: sqltypes.h:136
int16_t smallintval
Definition: sqltypes.h:134
Definition: sqltypes.h:53
Definition: sqltypes.h:54
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:265
Definition: sqltypes.h:42
Definition: sqltypes.h:46
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:32
double doubleval
Definition: sqltypes.h:138

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ChunkMetadata::fillChunkStats ( const Datum  min,
const Datum  max,
const bool  has_nulls 
)
inline

Definition at line 110 of file ChunkMetadata.h.

References chunkStats, ChunkStats::has_nulls, ChunkStats::max, and ChunkStats::min.

110  {
111  chunkStats.has_nulls = has_nulls;
112  chunkStats.min = min;
113  chunkStats.max = max;
114  }
bool has_nulls
Definition: ChunkMetadata.h:28
ChunkStats chunkStats
Definition: ChunkMetadata.h:35
bool ChunkMetadata::operator== ( const ChunkMetadata that) const
inline

Definition at line 116 of file ChunkMetadata.h.

References chunkStats, DatumEqual(), ChunkStats::has_nulls, ChunkStats::max, ChunkStats::min, numBytes, numElements, and sqlType.

116  {
117  return sqlType == that.sqlType && numBytes == that.numBytes &&
118  numElements == that.numElements &&
122  }
bool has_nulls
Definition: ChunkMetadata.h:28
ChunkStats chunkStats
Definition: ChunkMetadata.h:35
bool DatumEqual(const Datum a, const Datum b, const SQLTypeInfo &ti)
Definition: Datum.cpp:187
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:32
size_t numElements
Definition: ChunkMetadata.h:34

+ Here is the call graph for this function:

Member Data Documentation

ChunkStats ChunkMetadata::chunkStats

Definition at line 35 of file ChunkMetadata.h.

Referenced by fillChunkStats(), and operator==().

size_t ChunkMetadata::numBytes

Definition at line 33 of file ChunkMetadata.h.

Referenced by operator==().

size_t ChunkMetadata::numElements

Definition at line 34 of file ChunkMetadata.h.

Referenced by operator==().

SQLTypeInfo ChunkMetadata::sqlType

Definition at line 32 of file ChunkMetadata.h.

Referenced by fillChunkStats(), and operator==().


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