OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::ParquetDateInSecondsEncoder< NullType > Class Template Reference

#include <ParquetDateInSecondsEncoder.h>

+ Inheritance diagram for foreign_storage::ParquetDateInSecondsEncoder< NullType >:
+ Collaboration diagram for foreign_storage::ParquetDateInSecondsEncoder< NullType >:

Public Member Functions

 ParquetDateInSecondsEncoder (Data_Namespace::AbstractBuffer *buffer, const ColumnDescriptor *column_desciptor, const parquet::ColumnDescriptor *parquet_column_descriptor)
 
 ParquetDateInSecondsEncoder (Data_Namespace::AbstractBuffer *buffer)
 
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
 
void validate (const int8_t *parquet_data, const int64_t j, const SQLTypeInfo &column_type) const override
 
- Public Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< int64_t, int32_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)
 
void validate (const int8_t *parquet_data, const int64_t j, const SQLTypeInfo &column_type) const override
 
std::string integralTypeToString (const int64_t &element) const
 
bool isIntegralType (const SQLTypeInfo &type) const
 
std::string elementToString (const int64_t &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)
 

Private Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< int64_t, int32_t, NullType >
virtual bool encodingIsIdentityForSameTypes () const
 
std::pair< int32_t, int32_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_
 
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 NullType>
class foreign_storage::ParquetDateInSecondsEncoder< NullType >

Definition at line 23 of file ParquetDateInSecondsEncoder.h.

Constructor & Destructor Documentation

template<typename NullType >
foreign_storage::ParquetDateInSecondsEncoder< NullType >::ParquetDateInSecondsEncoder ( Data_Namespace::AbstractBuffer buffer,
const ColumnDescriptor column_desciptor,
const parquet::ColumnDescriptor *  parquet_column_descriptor 
)
inline

Definition at line 27 of file ParquetDateInSecondsEncoder.h.

References CHECK.

30  : TypedParquetInPlaceEncoder<int64_t, int32_t, NullType>(
31  buffer,
32  column_desciptor,
33  parquet_column_descriptor) {
34  CHECK(parquet_column_descriptor->logical_type()->is_date());
35  }
#define CHECK(condition)
Definition: Logger.h:291

Definition at line 37 of file ParquetDateInSecondsEncoder.h.

38  : TypedParquetInPlaceEncoder<int64_t, int32_t, NullType>(buffer,
39  sizeof(int64_t),
40  sizeof(int32_t)) {}

Member Function Documentation

template<typename NullType >
void foreign_storage::ParquetDateInSecondsEncoder< NullType >::encodeAndCopy ( const int8_t *  parquet_data_bytes,
int8_t *  omnisci_data_bytes 
)
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 42 of file ParquetDateInSecondsEncoder.h.

References kSecsPerDay.

43  {
44  const auto& parquet_data_value =
45  reinterpret_cast<const int32_t*>(parquet_data_bytes)[0];
46  auto& omnisci_data_value = reinterpret_cast<int64_t*>(omnisci_data_bytes)[0];
47  omnisci_data_value = parquet_data_value * kSecsPerDay;
48  }
static constexpr int64_t kSecsPerDay
template<typename NullType >
void foreign_storage::ParquetDateInSecondsEncoder< NullType >::validate ( std::shared_ptr< parquet::Statistics >  stats,
const SQLTypeInfo column_type 
) const
inlineoverridevirtual

Implements foreign_storage::ParquetMetadataValidator.

Definition at line 50 of file ParquetDateInSecondsEncoder.h.

References foreign_storage::TypedParquetInPlaceEncoder< V, T, NullType >::getUnencodedStats().

Referenced by foreign_storage::ParquetDateInSecondsEncoder< NullType >::validate().

51  {
52  auto [unencoded_stats_min, unencoded_stats_max] =
54  validate(unencoded_stats_min, column_type);
55  validate(unencoded_stats_max, column_type);
56  }
dictionary stats
Definition: report.py:116
void validate(std::shared_ptr< parquet::Statistics > stats, const SQLTypeInfo &column_type) const override
std::pair< T, T > getUnencodedStats(std::shared_ptr< parquet::Statistics > stats) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename NullType >
void foreign_storage::ParquetDateInSecondsEncoder< NullType >::validate ( const int8_t *  parquet_data,
const int64_t  j,
const SQLTypeInfo column_type 
) const
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 58 of file ParquetDateInSecondsEncoder.h.

References foreign_storage::ParquetDateInSecondsEncoder< NullType >::validate().

60  {
61  const auto& parquet_data_value = reinterpret_cast<const int32_t*>(parquet_data)[j];
62  validate(parquet_data_value, column_type);
63  }
void validate(std::shared_ptr< parquet::Statistics > stats, const SQLTypeInfo &column_type) const override

+ Here is the call graph for this function:

template<typename NullType >
void foreign_storage::ParquetDateInSecondsEncoder< NullType >::validate ( const int32_t &  value,
const SQLTypeInfo column_type 
) const
inlineprivate

Definition at line 66 of file ParquetDateInSecondsEncoder.h.

References CHECK, SQLTypeInfo::get_compression(), SQLTypeInfo::is_date(), kENCODING_NONE, kSecsPerDay, and foreign_storage::BaseDateBoundsValidator< T, is_in_seconds >::validateValue().

66  {
67  CHECK(column_type.is_date());
68  if (column_type.get_compression() ==
69  kENCODING_NONE) { // do not validate NONE ENCODED dates as it is impossible for
70  // bounds to be exceeded (the conversion done for this case is
71  // from a date in days as a 32-bit integer to a date in seconds
72  // as a 64-bit integer)
73  return;
74  }
76  column_type);
77  }
static constexpr int64_t kSecsPerDay
static void validateValue(const D &data_value, const SQLTypeInfo &column_type)
HOST DEVICE EncodingType get_compression() const
Definition: sqltypes.h:399
#define CHECK(condition)
Definition: Logger.h:291
bool is_date() const
Definition: sqltypes.h:1028

+ Here is the call graph for this function:


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