OmniSciDB  fe05a0c208
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 81 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 111 of file ParquetMetadataValidator.h.

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

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

112  {
113  CHECK(column_type.is_timestamp());
114  switch (column_type.get_size()) {
115  case 4:
116  return getMinMaxBoundsAsStrings<int32_t>(column_type);
117  case 8:
118  return getMinMaxBoundsAsStrings<int64_t>(column_type);
119  default:
120  UNREACHABLE();
121  }
122  return {};
123  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:324
bool is_timestamp() const
Definition: sqltypes.h:743
#define UNREACHABLE()
Definition: Logger.h:247
#define CHECK(condition)
Definition: Logger.h:203

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

References foreign_storage::datetime_to_string().

127  {
128  auto [min_value, max_value] = get_min_max_bounds<D>();
129  return {datetime_to_string(min_value, column_type),
130  datetime_to_string(max_value, column_type)};
131  }
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 87 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 >::validate(), and foreign_storage::ParquetFixedLengthEncoder< V, T >::validateIntegralOrFloatingPointValue().

87  {
88  if (!valueWithinBounds(data_value, column_type)) {
89  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
91  min_allowed_value,
92  max_allowed_value,
93  datetime_to_string(data_value, column_type));
94  }
95  }
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 98 of file ParquetMetadataValidator.h.

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

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

98  {
99  CHECK(column_type.is_timestamp());
100  switch (column_type.get_size()) {
101  case 4:
102  return check_bounds<int32_t>(value);
103  case 8:
104  return check_bounds<int64_t>(value);
105  default:
106  UNREACHABLE();
107  }
108  return {};
109  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:324
bool is_timestamp() const
Definition: sqltypes.h:743
#define UNREACHABLE()
Definition: Logger.h:247
#define CHECK(condition)
Definition: Logger.h:203

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