OmniSciDB  6686921089
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 270 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 313 of file ParquetMetadataValidator.h.

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

Definition at line 298 of file ParquetMetadataValidator.h.

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

299  {
300  CHECK(column_type.is_fp());
301  switch (column_type.get_size()) {
302  case 4:
303  return getMinMaxBoundsAsStrings<float>();
304  case 8:
305  return getMinMaxBoundsAsStrings<double>();
306  default:
307  UNREACHABLE();
308  }
309  return {};
310  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
bool is_fp() const
Definition: sqltypes.h:513
#define UNREACHABLE()
Definition: Logger.h:253
#define CHECK(condition)
Definition: Logger.h:209

+ 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 318 of file ParquetMetadataValidator.h.

References to_string().

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

318  {
319  auto [min_value, max_value] = get_min_max_bounds<D>();
320  return {std::to_string(min_value), std::to_string(max_value)};
321  }
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 276 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, NullType >::validateIntegralOrFloatingPointValue().

276  {
277  if (!valueWithinBounds(data_value, column_type)) {
278  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
280  min_allowed_value, max_allowed_value, std::to_string(data_value));
281  }
282  }
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 285 of file ParquetMetadataValidator.h.

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

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

285  {
286  CHECK(column_type.is_fp());
287  switch (column_type.get_size()) {
288  case 4:
289  return checkBounds<float>(value);
290  case 8:
291  return checkBounds<double>(value);
292  default:
293  UNREACHABLE();
294  }
295  return {};
296  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
bool is_fp() const
Definition: sqltypes.h:513
#define UNREACHABLE()
Definition: Logger.h:253
#define CHECK(condition)
Definition: Logger.h:209

+ 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: