21 namespace foreign_storage {
35 template <
typename V,
typename T, T conversion_denominator,
typename NullType = V>
41 const parquet::ColumnDescriptor* parquet_column_descriptor)
44 parquet_column_descriptor) {
45 CHECK(parquet_column_descriptor->logical_type()->is_timestamp());
49 int8_t* omnisci_data_bytes)
override {
50 const auto& parquet_data_value =
reinterpret_cast<const T*
>(parquet_data_bytes)[0];
51 auto& omnisci_data_value =
reinterpret_cast<V*
>(omnisci_data_bytes)[0];
52 omnisci_data_value =
convert(parquet_data_value);
58 const auto& parquet_data_value =
reinterpret_cast<const T*
>(parquet_data)[j];
59 validate(parquet_data_value, column_type);
64 auto [unencoded_stats_min, unencoded_stats_max] =
66 validate(unencoded_stats_min, column_type);
67 validate(unencoded_stats_max, column_type);
75 }
else if (column_type.
is_date()) {
82 T quotient = value / conversion_denominator;
83 return value < 0 && (value % conversion_denominator != 0) ? quotient - 1 : quotient;
87 template <
typename V,
typename T, T conversion_denominator,
typename NullType = V>
void encodeAndCopy(const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes) override
void validate(const T &value, const SQLTypeInfo &column_type) const
bool is_timestamp() const
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)
ParquetTimestampEncoder< V, T, conversion_denominator, NullType > ParquetDateInSecondsFromTimestampEncoder
void validate(const int8_t *parquet_data, const int64_t j, const SQLTypeInfo &column_type) const override
An AbstractBuffer is a unit of data management for a data manager.
specifies the content in-memory of a row in the column metadata table
ParquetTimestampEncoder(Data_Namespace::AbstractBuffer *buffer, const ColumnDescriptor *column_desciptor, const parquet::ColumnDescriptor *parquet_column_descriptor)
std::pair< T, T > getUnencodedStats(std::shared_ptr< parquet::Statistics > stats) const
T convert(const T &value) const
void validate(std::shared_ptr< parquet::Statistics > stats, const SQLTypeInfo &column_type) const override
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)