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

#include <ParquetTimestampEncoder.h>

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

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
 
- 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)
 

Private Attributes

conversion_denominator_
 

Additional Inherited Members

- Protected Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< V, T >
virtual bool encodingIsIdentityForSameTypes () const
 
- Static Protected Member Functions inherited from foreign_storage::ParquetEncoder
static std::shared_ptr
< ChunkMetadata
createMetadata (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>
class foreign_storage::ParquetTimestampEncoder< V, T >

Definition at line 23 of file ParquetTimestampEncoder.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file ParquetTimestampEncoder.h.

References CHECK, foreign_storage::ParquetTimestampEncoder< V, T >::conversion_denominator_, and foreign_storage::get_time_conversion_denominator().

28  : TypedParquetInPlaceEncoder<V, T>(buffer,
29  column_desciptor,
30  parquet_column_descriptor) {
31  auto timestamp_logical_type = dynamic_cast<const parquet::TimestampLogicalType*>(
32  parquet_column_descriptor->logical_type().get());
33  CHECK(timestamp_logical_type);
35  get_time_conversion_denominator(timestamp_logical_type->time_unit());
36  }
int64_t get_time_conversion_denominator(const parquet::LogicalType::TimeUnit::unit time_unit)
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

Member Function Documentation

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

Definition at line 46 of file ParquetTimestampEncoder.h.

References foreign_storage::ParquetTimestampEncoder< V, T >::conversion_denominator_.

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

46  {
47  return value < 0 && (value % conversion_denominator_ != 0)
48  ? value / conversion_denominator_ - 1
49  : value / conversion_denominator_;
50  }

+ Here is the caller graph for this function:

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

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 38 of file ParquetTimestampEncoder.h.

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

39  {
40  const auto& parquet_data_value = reinterpret_cast<const T*>(parquet_data_bytes)[0];
41  auto& omnisci_data_value = reinterpret_cast<V*>(omnisci_data_bytes)[0];
42  omnisci_data_value = convert(parquet_data_value);
43  }

+ Here is the call graph for this function:

Member Data Documentation


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