OmniSciDB  e4d26eaa36
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 D &display_data_value, const SQLTypeInfo &column_type)
 
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

◆ getMinMaxBoundsAsStrings() [1/2]

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

Definition at line 118 of file ParquetMetadataValidator.h.

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

119  {
120  CHECK(column_type.is_timestamp());
121  switch (column_type.get_size()) {
122  case 4:
123  return getMinMaxBoundsAsStrings<int32_t>(column_type);
124  case 8:
125  return getMinMaxBoundsAsStrings<int64_t>(column_type);
126  default:
127  UNREACHABLE();
128  }
129  return {};
130  }
#define UNREACHABLE()
Definition: Logger.h:241
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
#define CHECK(condition)
Definition: Logger.h:197
bool is_timestamp() const
Definition: sqltypes.h:727
+ Here is the call graph for this function:

◆ getMinMaxBoundsAsStrings() [2/2]

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

References foreign_storage::datetime_to_string().

134  {
135  auto [min_value, max_value] = get_min_max_bounds<D>();
136  return {datetime_to_string(min_value, column_type),
137  datetime_to_string(max_value, column_type)};
138  }
std::string datetime_to_string(const D &timestamp, const SQLTypeInfo &column_type)
+ Here is the call graph for this function:

◆ validateValue() [1/2]

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

Definition at line 87 of file ParquetMetadataValidator.h.

References foreign_storage::datetime_to_string(), and foreign_storage::throw_parquet_metadata_out_of_bounds_error().

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

89  {
90  if (!valueWithinBounds(data_value, column_type)) {
91  auto [min_allowed_value, max_allowed_value] = getMinMaxBoundsAsStrings(column_type);
93  min_allowed_value,
94  max_allowed_value,
95  datetime_to_string(display_data_value, column_type));
96  }
97  }
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:

◆ validateValue() [2/2]

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

100  {
101  validateValue(data_value, data_value, column_type);
102  }
static void validateValue(const D &data_value, const D &display_data_value, const SQLTypeInfo &column_type)

◆ valueWithinBounds()

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

Definition at line 105 of file ParquetMetadataValidator.h.

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

105  {
106  CHECK(column_type.is_timestamp());
107  switch (column_type.get_size()) {
108  case 4:
109  return check_bounds<int32_t>(value);
110  case 8:
111  return check_bounds<int64_t>(value);
112  default:
113  UNREACHABLE();
114  }
115  return {};
116  }
#define UNREACHABLE()
Definition: Logger.h:241
HOST DEVICE int get_size() const
Definition: sqltypes.h:321
#define CHECK(condition)
Definition: Logger.h:197
bool is_timestamp() const
Definition: sqltypes.h:727
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: