OmniSciDB  72c90bc290
 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 280 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 323 of file ParquetMetadataValidator.h.

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

Definition at line 308 of file ParquetMetadataValidator.h.

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

309  {
310  CHECK(column_type.is_fp());
311  switch (column_type.get_size()) {
312  case 4:
313  return getMinMaxBoundsAsStrings<float>();
314  case 8:
315  return getMinMaxBoundsAsStrings<double>();
316  default:
317  UNREACHABLE();
318  }
319  return {};
320  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
bool is_fp() const
Definition: sqltypes.h:571
#define UNREACHABLE()
Definition: Logger.h:338
#define CHECK(condition)
Definition: Logger.h:291

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

References to_string().

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

328  {
329  auto [min_value, max_value] = get_min_max_bounds<D>();
330  return {std::to_string(min_value), std::to_string(max_value)};
331  }
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 286 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().

286  {
287  if (!valueWithinBounds(data_value, column_type)) {
288  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
290  min_allowed_value, max_allowed_value, std::to_string(data_value));
291  }
292  }
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 295 of file ParquetMetadataValidator.h.

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

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

295  {
296  CHECK(column_type.is_fp());
297  switch (column_type.get_size()) {
298  case 4:
299  return checkBounds<float>(value);
300  case 8:
301  return checkBounds<double>(value);
302  default:
303  UNREACHABLE();
304  }
305  return {};
306  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
bool is_fp() const
Definition: sqltypes.h:571
#define UNREACHABLE()
Definition: Logger.h:338
#define CHECK(condition)
Definition: Logger.h:291

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