OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator > Class Template Reference

#include <ParquetTimestampEncoder.h>

+ Inheritance diagram for foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >:
+ Collaboration diagram for foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >:

Public Member Functions

 ParquetTimestampEncoder (Data_Namespace::AbstractBuffer *buffer, const ColumnDescriptor *column_desciptor, const parquet::ColumnDescriptor *parquet_column_descriptor)
 
void encodeAndCopy (const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes) override
 
void validate (std::shared_ptr< parquet::Statistics > stats, const SQLTypeInfo &column_type) const override
 
- Public Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< V, T >
 TypedParquetInPlaceEncoder (Data_Namespace::AbstractBuffer *buffer, const ColumnDescriptor *column_desciptor, const parquet::ColumnDescriptor *parquet_column_descriptor)
 
 TypedParquetInPlaceEncoder (Data_Namespace::AbstractBuffer *buffer, const size_t omnisci_data_type_byte_size, const size_t parquet_data_type_byte_size)
 
void appendData (const int16_t *def_levels, const int16_t *rep_levels, const int64_t values_read, const int64_t levels_read, const bool is_last_batch, int8_t *values) override
 
void encodeAndCopyContiguous (const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes, const size_t num_elements) override
 
void setNull (int8_t *omnisci_data_bytes) override
 
void copy (const int8_t *omnisci_data_bytes_source, int8_t *omnisci_data_bytes_destination) override
 
std::shared_ptr< ChunkMetadatagetRowGroupMetadata (const parquet::RowGroupMetaData *group_metadata, const int parquet_column_index, const SQLTypeInfo &column_type) override
 
- Public Member Functions inherited from foreign_storage::ParquetInPlaceEncoder
 ParquetInPlaceEncoder (Data_Namespace::AbstractBuffer *buffer, const size_t omnisci_data_type_byte_size, const size_t parquet_data_type_byte_size)
 
- Public Member Functions inherited from foreign_storage::ParquetScalarEncoder
 ParquetScalarEncoder (Data_Namespace::AbstractBuffer *buffer)
 
- Public Member Functions inherited from foreign_storage::ParquetEncoder
 ParquetEncoder (Data_Namespace::AbstractBuffer *buffer)
 
virtual ~ParquetEncoder ()=default
 

Private Member Functions

convert (const T &value) const
 

Additional Inherited Members

- Protected Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< V, T >
virtual bool encodingIsIdentityForSameTypes () const
 
std::pair< T, T > getUnencodedStats (std::shared_ptr< parquet::Statistics > stats) const
 
- Static Protected Member Functions inherited from foreign_storage::ParquetEncoder
static std::shared_ptr
< ChunkMetadata
createMetadata (const SQLTypeInfo &column_type)
 
static void throwNotNullViolation (const std::string &parquet_column_name)
 
static void validateNullCount (const std::string &parquet_column_name, int64_t null_count, const SQLTypeInfo &column_type)
 
- Protected Attributes inherited from foreign_storage::ParquetInPlaceEncoder
const size_t omnisci_data_type_byte_size_
 
- Protected Attributes inherited from foreign_storage::ParquetEncoder
Data_Namespace::AbstractBufferbuffer_
 

Detailed Description

template<typename V, typename T, T conversion_denominator>
class foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >

Definition at line 35 of file ParquetTimestampEncoder.h.

Constructor & Destructor Documentation

template<typename V , typename T , T conversion_denominator>
foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >::ParquetTimestampEncoder ( Data_Namespace::AbstractBuffer buffer,
const ColumnDescriptor column_desciptor,
const parquet::ColumnDescriptor *  parquet_column_descriptor 
)
inline

Definition at line 38 of file ParquetTimestampEncoder.h.

References CHECK.

41  : TypedParquetInPlaceEncoder<V, T>(buffer,
42  column_desciptor,
43  parquet_column_descriptor) {
44  CHECK(parquet_column_descriptor->logical_type()->is_timestamp());
45  }
#define CHECK(condition)
Definition: Logger.h:203

Member Function Documentation

template<typename V , typename T , T conversion_denominator>
T foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >::convert ( const T &  value) const
inlineprivate

Definition at line 73 of file ParquetTimestampEncoder.h.

References omnisci.dtypes::T.

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

73  {
74  T quotient = value / conversion_denominator;
75  return value < 0 && (value % conversion_denominator != 0) ? quotient - 1 : quotient;
76  }

+ Here is the caller graph for this function:

template<typename V , typename T , T conversion_denominator>
void foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >::encodeAndCopy ( const int8_t *  parquet_data_bytes,
int8_t *  omnisci_data_bytes 
)
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 47 of file ParquetTimestampEncoder.h.

References foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >::convert(), and omnisci.dtypes::T.

48  {
49  const auto& parquet_data_value = reinterpret_cast<const T*>(parquet_data_bytes)[0];
50  auto& omnisci_data_value = reinterpret_cast<V*>(omnisci_data_bytes)[0];
51  omnisci_data_value = convert(parquet_data_value);
52  }

+ Here is the call graph for this function:

template<typename V , typename T , T conversion_denominator>
void foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >::validate ( std::shared_ptr< parquet::Statistics >  stats,
const SQLTypeInfo column_type 
) const
inlineoverridevirtual

Implements foreign_storage::ParquetMetadataValidator.

Definition at line 54 of file ParquetTimestampEncoder.h.

References CHECK, foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator >::convert(), foreign_storage::TypedParquetInPlaceEncoder< V, T >::getUnencodedStats(), SQLTypeInfo::is_date(), SQLTypeInfo::is_timestamp(), foreign_storage::TimestampBoundsValidator< T >::validateValue(), and foreign_storage::DateInSecondsBoundsValidator< T >::validateValue().

55  {
56  CHECK(column_type.is_timestamp() || column_type.is_date());
57  auto [unencoded_stats_min, unencoded_stats_max] =
59  if (column_type.is_timestamp()) {
61  column_type);
63  column_type);
64  } else if (column_type.is_date()) {
66  column_type);
68  column_type);
69  }
70  }
bool is_timestamp() const
Definition: sqltypes.h:743
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)
#define CHECK(condition)
Definition: Logger.h:203
std::pair< T, T > getUnencodedStats(std::shared_ptr< parquet::Statistics > stats) const
bool is_date() const
Definition: sqltypes.h:731
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)

+ Here is the call graph for this function:


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