OmniSciDB  bf83d84833
 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 298 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 341 of file ParquetMetadataValidator.h.

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

Definition at line 326 of file ParquetMetadataValidator.h.

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

327  {
328  CHECK(column_type.is_fp());
329  switch (column_type.get_size()) {
330  case 4:
331  return getMinMaxBoundsAsStrings<float>();
332  case 8:
333  return getMinMaxBoundsAsStrings<double>();
334  default:
335  UNREACHABLE();
336  }
337  return {};
338  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
bool is_fp() const
Definition: sqltypes.h:482
#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 346 of file ParquetMetadataValidator.h.

References to_string().

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

346  {
347  auto [min_value, max_value] = get_min_max_bounds<D>();
348  return {std::to_string(min_value), std::to_string(max_value)};
349  }
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 304 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().

304  {
305  if (!valueWithinBounds(data_value, column_type)) {
306  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
308  min_allowed_value, max_allowed_value, std::to_string(data_value));
309  }
310  }
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 313 of file ParquetMetadataValidator.h.

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

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

313  {
314  CHECK(column_type.is_fp());
315  switch (column_type.get_size()) {
316  case 4:
317  return checkBounds<float>(value);
318  case 8:
319  return checkBounds<double>(value);
320  default:
321  UNREACHABLE();
322  }
323  return {};
324  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
bool is_fp() const
Definition: sqltypes.h:482
#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: