OmniSciDB  04ee39c94c
ChunkMetadata Struct Reference

#include <ChunkMetadata.h>

+ Collaboration diagram for ChunkMetadata:

Public Member Functions

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.

Member Function Documentation

◆ fillChunkStats() [1/2]

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

Definition at line 38 of file ChunkMetadata.h.

References Datum::bigintval, Datum::doubleval, Datum::floatval, SQLTypeInfoCore< TYPE_FACET_PACK >::get_compression(), SQLTypeInfoCore< TYPE_FACET_PACK >::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, and Datum::tinyintval.

Referenced by DateDaysEncoder< T, V >::getMetadata(), FixedLengthEncoder< T, V >::getMetadata(), NoneEncoder< T >::getMetadata(), FixedLengthArrayNoneEncoder::getMetadata(), ArrayNoneEncoder::getMetadata(), and anonymous_namespace{TableOptimizer.cpp}::set_metadata_from_results().

38  {
39  chunkStats.has_nulls = has_nulls;
40  switch (sqlType.get_type()) {
41  case kBOOLEAN: {
44  break;
45  }
46  case kTINYINT: {
49  break;
50  }
51  case kSMALLINT: {
54  break;
55  }
56  case kINT: {
57  chunkStats.min.intval = min;
58  chunkStats.max.intval = max;
59  break;
60  }
61  case kBIGINT:
62  case kNUMERIC:
63  case kDECIMAL: {
64  chunkStats.min.bigintval = min;
65  chunkStats.max.bigintval = max;
66  break;
67  }
68  case kTIME:
69  case kTIMESTAMP:
70  case kDATE: {
71  chunkStats.min.bigintval = min;
72  chunkStats.max.bigintval = max;
73  break;
74  }
75  case kFLOAT: {
76  chunkStats.min.floatval = min;
77  chunkStats.max.floatval = max;
78  break;
79  }
80  case kDOUBLE: {
81  chunkStats.min.doubleval = min;
82  chunkStats.max.doubleval = max;
83  break;
84  }
85  case kVARCHAR:
86  case kCHAR:
87  case kTEXT:
89  chunkStats.min.intval = min;
90  chunkStats.max.intval = max;
91  }
92  break;
93  default: {
94  break;
95  }
96  }
97  }
int8_t tinyintval
Definition: sqltypes.h:123
Definition: sqltypes.h:51
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:323
bool has_nulls
Definition: ChunkMetadata.h:28
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:331
int32_t intval
Definition: sqltypes.h:125
ChunkStats chunkStats
Definition: ChunkMetadata.h:35
float floatval
Definition: sqltypes.h:127
int64_t bigintval
Definition: sqltypes.h:126
int16_t smallintval
Definition: sqltypes.h:124
Definition: sqltypes.h:54
Definition: sqltypes.h:55
Definition: sqltypes.h:43
Definition: sqltypes.h:47
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:32
double doubleval
Definition: sqltypes.h:128
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillChunkStats() [2/2]

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

Definition at line 99 of file ChunkMetadata.h.

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

99  {
100  chunkStats.has_nulls = has_nulls;
101  chunkStats.min = min;
102  chunkStats.max = max;
103  }
bool has_nulls
Definition: ChunkMetadata.h:28
ChunkStats chunkStats
Definition: ChunkMetadata.h:35

◆ operator==()

bool ChunkMetadata::operator== ( const ChunkMetadata that) const
inline

Definition at line 105 of file ChunkMetadata.h.

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

105  {
106  return sqlType == that.sqlType && numBytes == that.numBytes &&
107  numElements == that.numElements &&
111  }
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:153
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

◆ numBytes

size_t ChunkMetadata::numBytes

Definition at line 33 of file ChunkMetadata.h.

Referenced by Encoder::getMetadata(), and operator==().

◆ numElements

size_t ChunkMetadata::numElements

◆ sqlType

SQLTypeInfo ChunkMetadata::sqlType

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