OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ChunkMetadata.h File Reference
#include <cstddef>
#include <iostream>
#include "Logger/Logger.h"
#include "Shared/StringTransform.h"
#include "Shared/sqltypes.h"
#include "Shared/types.h"
+ Include dependency graph for ChunkMetadata.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ChunkStats
 
struct  ChunkMetadata
 

Typedefs

using ChunkMetadataMap = std::map< int, std::shared_ptr< ChunkMetadata >>
 
using ChunkMetadataVector = std::vector< std::pair< ChunkKey, std::shared_ptr< ChunkMetadata >>>
 

Functions

std::ostream & operator<< (std::ostream &out, const ChunkMetadata &chunk_metadata)
 
int64_t extract_min_stat_int_type (const ChunkStats &stats, const SQLTypeInfo &ti)
 
int64_t extract_max_stat_int_type (const ChunkStats &stats, const SQLTypeInfo &ti)
 
double extract_min_stat_fp_type (const ChunkStats &stats, const SQLTypeInfo &ti)
 
double extract_max_stat_fp_type (const ChunkStats &stats, const SQLTypeInfo &ti)
 

Typedef Documentation

using ChunkMetadataMap = std::map<int, std::shared_ptr<ChunkMetadata>>

Definition at line 199 of file ChunkMetadata.h.

using ChunkMetadataVector = std::vector<std::pair<ChunkKey, std::shared_ptr<ChunkMetadata>>>

Definition at line 201 of file ChunkMetadata.h.

Function Documentation

double extract_max_stat_fp_type ( const ChunkStats stats,
const SQLTypeInfo ti 
)
inline

Definition at line 195 of file ChunkMetadata.h.

References extract_fp_type_from_datum(), and ChunkStats::max.

Referenced by Executor::canSkipFragmentForFpQual(), and getLeafColumnRange().

195  {
196  return extract_fp_type_from_datum(stats.max, ti);
197 }
double extract_fp_type_from_datum(const Datum datum, const SQLTypeInfo &ti)
Definition: Datum.cpp:549

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t extract_max_stat_int_type ( const ChunkStats stats,
const SQLTypeInfo ti 
)
inline

Definition at line 187 of file ChunkMetadata.h.

References extract_int_type_from_datum(), and ChunkStats::max.

Referenced by getLeafColumnRange(), Executor::isFragmentFullyDeleted(), anonymous_namespace{StorageIOFacility.h}::should_recompute_metadata(), and Executor::skipFragment().

187  {
188  return extract_int_type_from_datum(stats.max, ti);
189 }
int64_t extract_int_type_from_datum(const Datum datum, const SQLTypeInfo &ti)
Definition: Datum.cpp:523

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

double extract_min_stat_fp_type ( const ChunkStats stats,
const SQLTypeInfo ti 
)
inline

Definition at line 191 of file ChunkMetadata.h.

References extract_fp_type_from_datum(), and ChunkStats::min.

Referenced by Executor::canSkipFragmentForFpQual(), and getLeafColumnRange().

191  {
192  return extract_fp_type_from_datum(stats.min, ti);
193 }
double extract_fp_type_from_datum(const Datum datum, const SQLTypeInfo &ti)
Definition: Datum.cpp:549

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int64_t extract_min_stat_int_type ( const ChunkStats stats,
const SQLTypeInfo ti 
)
inline

Definition at line 183 of file ChunkMetadata.h.

References extract_int_type_from_datum(), and ChunkStats::min.

Referenced by getLeafColumnRange(), Executor::isFragmentFullyDeleted(), anonymous_namespace{StorageIOFacility.h}::should_recompute_metadata(), and Executor::skipFragment().

183  {
184  return extract_int_type_from_datum(stats.min, ti);
185 }
int64_t extract_int_type_from_datum(const Datum datum, const SQLTypeInfo &ti)
Definition: Datum.cpp:523

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::ostream& operator<< ( std::ostream &  out,
const ChunkMetadata chunk_metadata 
)
inline

Definition at line 161 of file ChunkMetadata.h.

References ChunkMetadata::chunkStats, DatumToString(), SQLTypeInfo::get_elem_type(), SQLTypeInfo::get_type_name(), ChunkStats::has_nulls, Datum::intval, SQLTypeInfo::is_array(), kENCODING_NONE, ChunkStats::max, ChunkStats::min, ChunkMetadata::numBytes, ChunkMetadata::numElements, ChunkMetadata::sqlType, to_string(), and run_benchmark_import::type.

161  {
162  auto type = chunk_metadata.sqlType.is_array() ? chunk_metadata.sqlType.get_elem_type()
163  : chunk_metadata.sqlType;
164  // Unencoded strings have no min/max.
165  std::string min, max;
166  if (type.is_string() && type.get_compression() == kENCODING_NONE) {
167  min = "<invalid>";
168  max = "<invalid>";
169  } else if (type.is_string()) {
170  min = to_string(chunk_metadata.chunkStats.min.intval);
171  max = to_string(chunk_metadata.chunkStats.max.intval);
172  } else {
173  min = DatumToString(chunk_metadata.chunkStats.min, type);
174  max = DatumToString(chunk_metadata.chunkStats.max, type);
175  }
176  out << "type: " << chunk_metadata.sqlType.get_type_name()
177  << " numBytes: " << chunk_metadata.numBytes << " numElements "
178  << chunk_metadata.numElements << " min: " << min << " max: " << max
179  << " has_nulls: " << std::to_string(chunk_metadata.chunkStats.has_nulls);
180  return out;
181 }
std::string DatumToString(Datum d, const SQLTypeInfo &ti)
Definition: Datum.cpp:460
bool has_nulls
Definition: ChunkMetadata.h:30
int32_t intval
Definition: Datum.h:75
std::string to_string(char const *&&v)
ChunkStats chunkStats
Definition: ChunkMetadata.h:37
std::string get_type_name() const
Definition: sqltypes.h:484
SQLTypeInfo get_elem_type() const
Definition: sqltypes.h:977
SQLTypeInfo sqlType
Definition: ChunkMetadata.h:34
bool is_array() const
Definition: sqltypes.h:585
size_t numElements
Definition: ChunkMetadata.h:36

+ Here is the call graph for this function: