OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::TimestampBoundsValidator< 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 std::pair< std::string,
std::string > 
getMinMaxBoundsAsStrings (const SQLTypeInfo &column_type)
 

Detailed Description

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

Definition at line 60 of file ParquetMetadataValidator.h.

Member Function Documentation

template<typename T >
static std::pair<std::string, std::string> foreign_storage::TimestampBoundsValidator< T >::getMinMaxBoundsAsStrings ( const SQLTypeInfo column_type)
inlinestaticprivate

Definition at line 90 of file ParquetMetadataValidator.h.

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

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

91  {
92  CHECK(column_type.is_timestamp());
93  switch (column_type.get_size()) {
94  case 4:
95  return getMinMaxBoundsAsStrings<int32_t>(column_type);
96  case 8:
97  return getMinMaxBoundsAsStrings<int64_t>(column_type);
98  default:
99  UNREACHABLE();
100  }
101  return {};
102  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
bool is_timestamp() const
Definition: sqltypes.h:1044
#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:

template<typename T >
template<typename D >
static std::pair<std::string, std::string> foreign_storage::TimestampBoundsValidator< T >::getMinMaxBoundsAsStrings ( const SQLTypeInfo column_type)
inlinestaticprivate

Definition at line 105 of file ParquetMetadataValidator.h.

References foreign_storage::datetime_to_string().

106  {
107  auto [min_value, max_value] = get_min_max_bounds<D>();
108  return {datetime_to_string(min_value, column_type),
109  datetime_to_string(max_value, column_type)};
110  }
std::string datetime_to_string(const D &timestamp, const SQLTypeInfo &column_type)

+ Here is the call graph for this function:

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

Definition at line 66 of file ParquetMetadataValidator.h.

References foreign_storage::datetime_to_string(), foreign_storage::TimestampBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::throw_parquet_metadata_out_of_bounds_error(), and foreign_storage::TimestampBoundsValidator< T >::valueWithinBounds().

Referenced by foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator *kSecsPerDay, NullType >::validate(), and foreign_storage::ParquetFixedLengthEncoder< V, T, NullType >::validateIntegralOrFloatingPointValue().

66  {
67  if (!valueWithinBounds(data_value, column_type)) {
68  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
70  min_allowed_value,
71  max_allowed_value,
72  datetime_to_string(data_value, column_type));
73  }
74  }
static std::pair< std::string, std::string > getMinMaxBoundsAsStrings(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)
static bool valueWithinBounds(const T &value, const SQLTypeInfo &column_type)
std::string datetime_to_string(const D &timestamp, const SQLTypeInfo &column_type)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 77 of file ParquetMetadataValidator.h.

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

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

77  {
78  CHECK(column_type.is_timestamp());
79  switch (column_type.get_size()) {
80  case 4:
81  return check_bounds<int32_t>(value);
82  case 8:
83  return check_bounds<int64_t>(value);
84  default:
85  UNREACHABLE();
86  }
87  return {};
88  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
bool is_timestamp() const
Definition: sqltypes.h:1044
#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: