OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::FloatPointValidator< T > Class Template Reference

#include <ParquetMetadataValidator.h>

Static Public Member Functions

template<typename D >
static void validateValue (const D &data_value, const SQLTypeInfo &column_type)
 

Static Private Member Functions

static bool valueWithinBounds (const T &value, const SQLTypeInfo &column_type)
 
static std::pair< std::string,
std::string > 
getMinMaxBoundsAsStrings (const SQLTypeInfo &column_type)
 
template<typename D >
static bool checkBounds (const T &value)
 
template<typename D >
static std::pair< std::string,
std::string > 
getMinMaxBoundsAsStrings ()
 

Detailed Description

template<typename T>
class foreign_storage::FloatPointValidator< T >

Definition at line 291 of file ParquetMetadataValidator.h.

Member Function Documentation

template<typename T >
template<typename D >
static bool foreign_storage::FloatPointValidator< T >::checkBounds ( const T &  value)
inlinestaticprivate

Definition at line 334 of file ParquetMetadataValidator.h.

334  {
335  return check_bounds<D>(value);
336  }
template<typename T >
static std::pair<std::string, std::string> foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings ( const SQLTypeInfo column_type)
inlinestaticprivate

Definition at line 319 of file ParquetMetadataValidator.h.

References CHECK, SQLTypeInfo::get_size(), SQLTypeInfo::is_fp(), and UNREACHABLE.

320  {
321  CHECK(column_type.is_fp());
322  switch (column_type.get_size()) {
323  case 4:
324  return getMinMaxBoundsAsStrings<float>();
325  case 8:
326  return getMinMaxBoundsAsStrings<double>();
327  default:
328  UNREACHABLE();
329  }
330  return {};
331  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:324
bool is_fp() const
Definition: sqltypes.h:492
#define UNREACHABLE()
Definition: Logger.h:241
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

template<typename T >
template<typename D >
static std::pair<std::string, std::string> foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings ( )
inlinestaticprivate

Definition at line 339 of file ParquetMetadataValidator.h.

References to_string().

Referenced by foreign_storage::FloatPointValidator< T >::validateValue().

339  {
340  auto [min_value, max_value] = get_min_max_bounds<D>();
341  return {std::to_string(min_value), std::to_string(max_value)};
342  }
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
template<typename D >
static void foreign_storage::FloatPointValidator< T >::validateValue ( const D &  data_value,
const SQLTypeInfo column_type 
)
inlinestatic

Definition at line 297 of file ParquetMetadataValidator.h.

References foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::throw_parquet_metadata_out_of_bounds_error(), to_string(), and foreign_storage::FloatPointValidator< T >::valueWithinBounds().

Referenced by foreign_storage::ParquetFixedLengthEncoder< V, T >::validateIntegralOrFloatingPointValue().

297  {
298  if (!valueWithinBounds(data_value, column_type)) {
299  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
301  min_allowed_value, max_allowed_value, std::to_string(data_value));
302  }
303  }
static bool valueWithinBounds(const T &value, const SQLTypeInfo &column_type)
void throw_parquet_metadata_out_of_bounds_error(const std::string &min_value, const std::string &max_value, const std::string &encountered_value)
std::string to_string(char const *&&v)
static std::pair< std::string, std::string > getMinMaxBoundsAsStrings()

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
static bool foreign_storage::FloatPointValidator< T >::valueWithinBounds ( const T &  value,
const SQLTypeInfo column_type 
)
inlinestaticprivate

Definition at line 306 of file ParquetMetadataValidator.h.

References CHECK, SQLTypeInfo::get_size(), SQLTypeInfo::is_fp(), and UNREACHABLE.

Referenced by foreign_storage::FloatPointValidator< T >::validateValue().

306  {
307  CHECK(column_type.is_fp());
308  switch (column_type.get_size()) {
309  case 4:
310  return checkBounds<float>(value);
311  case 8:
312  return checkBounds<double>(value);
313  default:
314  UNREACHABLE();
315  }
316  return {};
317  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:324
bool is_fp() const
Definition: sqltypes.h:492
#define UNREACHABLE()
Definition: Logger.h:241
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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