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

#include <ParquetTimestampEncoder.h>

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

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 (const int8_t *parquet_data, const int64_t j, const SQLTypeInfo &column_type) const 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, NullType >
 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)
 
std::string integralTypeToString (const V &element) const
 
bool isIntegralType (const SQLTypeInfo &type) const
 
std::string elementToString (const V &element) const
 
std::string encodedDataToString (const int8_t *bytes) const override
 
void setDetectBufferConverterType ()
 
void validateUsingEncodersColumnType (const int8_t *parquet_data, const int64_t j) const override
 
void reserve (const size_t num_append_elements) override
 
void appendDataTrackErrors (const int16_t *def_levels, const int16_t *rep_levels, const int64_t values_read, const int64_t levels_read, int8_t *values) override
 
void validateAndAppendData (const int16_t *def_levels, const int16_t *rep_levels, const int64_t values_read, const int64_t levels_read, int8_t *values, const SQLTypeInfo &column_type, InvalidRowGroupIndices &invalid_indices) override
 
void eraseInvalidIndicesInBuffer (const InvalidRowGroupIndices &invalid_indices) override
 
void appendData (const int16_t *def_levels, const int16_t *rep_levels, const int64_t values_read, const int64_t levels_read, 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
 
RejectedRowIndices getRejectedRowIndices () const
 
virtual void disableMetadataStatsValidation ()
 
virtual void initializeErrorTracking ()
 
virtual void initializeColumnType (const SQLTypeInfo &column_type)
 

Protected Member Functions

convert (const T &value) const
 
- Protected Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< V, T, NullType >
virtual bool encodingIsIdentityForSameTypes () const
 
std::pair< T, T > getUnencodedStats (std::shared_ptr< parquet::Statistics > stats) const
 

Private Member Functions

void validate (const T &value, const SQLTypeInfo &column_type) const
 

Additional Inherited Members

- 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_
 
const size_t parquet_data_type_byte_size_
 
- Protected Attributes inherited from foreign_storage::ParquetEncoder
Data_Namespace::AbstractBufferbuffer_
 
bool is_error_tracking_enabled_
 
RejectedRowIndices invalid_indices_
 
size_t current_chunk_offset_
 
SQLTypeInfo column_type_
 
bool validate_metadata_stats_
 

Detailed Description

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

Definition at line 36 of file ParquetTimestampEncoder.h.

Constructor & Destructor Documentation

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

Definition at line 39 of file ParquetTimestampEncoder.h.

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

Member Function Documentation

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

Definition at line 81 of file ParquetTimestampEncoder.h.

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

81  {
82  T quotient = value / conversion_denominator;
83  return value < 0 && (value % conversion_denominator != 0) ? quotient - 1 : quotient;
84  }

+ Here is the caller graph for this function:

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

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 48 of file ParquetTimestampEncoder.h.

49  {
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);
53  }
template<typename V, typename T, T conversion_denominator, typename NullType = V>
void foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator, NullType >::validate ( const int8_t *  parquet_data,
const int64_t  j,
const SQLTypeInfo column_type 
) const
inlineoverridevirtual

Reimplemented from foreign_storage::TypedParquetInPlaceEncoder< V, T, NullType >.

Definition at line 55 of file ParquetTimestampEncoder.h.

Referenced by foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator *kSecsPerDay, NullType >::validate().

57  {
58  const auto& parquet_data_value = reinterpret_cast<const T*>(parquet_data)[j];
59  validate(parquet_data_value, column_type);
60  }
void validate(const int8_t *parquet_data, const int64_t j, const SQLTypeInfo &column_type) const override

+ Here is the caller graph for this function:

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

Implements foreign_storage::ParquetMetadataValidator.

Definition at line 62 of file ParquetTimestampEncoder.h.

63  {
64  auto [unencoded_stats_min, unencoded_stats_max] =
66  validate(unencoded_stats_min, column_type);
67  validate(unencoded_stats_max, column_type);
68  }
dictionary stats
Definition: report.py:116
void validate(const int8_t *parquet_data, const int64_t j, const SQLTypeInfo &column_type) const override
std::pair< T, T > getUnencodedStats(std::shared_ptr< parquet::Statistics > stats) const
template<typename V, typename T, T conversion_denominator, typename NullType = V>
void foreign_storage::ParquetTimestampEncoder< V, T, conversion_denominator, NullType >::validate ( const T &  value,
const SQLTypeInfo column_type 
) const
inlineprivate

Definition at line 71 of file ParquetTimestampEncoder.h.

71  {
72  CHECK(column_type.is_timestamp() || column_type.is_date());
73  if (column_type.is_timestamp()) {
75  } else if (column_type.is_date()) {
77  }
78  }
bool is_timestamp() const
Definition: sqltypes.h:1046
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)
#define CHECK(condition)
Definition: Logger.h:291
bool is_date() const
Definition: sqltypes.h:1028
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)

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