OmniSciDB  85c2d10cdc
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::ParquetDateInSecondsEncoder Class Reference

#include <ParquetDateInSecondsEncoder.h>

+ Inheritance diagram for foreign_storage::ParquetDateInSecondsEncoder:
+ Collaboration diagram for foreign_storage::ParquetDateInSecondsEncoder:

Public Member Functions

 ParquetDateInSecondsEncoder (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< int64_t, int32_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
 

Additional Inherited Members

- Protected Member Functions inherited from foreign_storage::TypedParquetInPlaceEncoder< int64_t, int32_t >
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_
 
- Protected Attributes inherited from foreign_storage::ParquetEncoder
Data_Namespace::AbstractBufferbuffer_
 

Detailed Description

Definition at line 22 of file ParquetDateInSecondsEncoder.h.

Constructor & Destructor Documentation

foreign_storage::ParquetDateInSecondsEncoder::ParquetDateInSecondsEncoder ( Data_Namespace::AbstractBuffer buffer,
const ColumnDescriptor column_desciptor,
const parquet::ColumnDescriptor *  parquet_column_descriptor 
)
inline

Definition at line 25 of file ParquetDateInSecondsEncoder.h.

References CHECK.

28  : TypedParquetInPlaceEncoder<int64_t, int32_t>(buffer,
29  column_desciptor,
30  parquet_column_descriptor) {
31  CHECK(parquet_column_descriptor->logical_type()->is_date());
32  }
#define CHECK(condition)
Definition: Logger.h:197

Member Function Documentation

void foreign_storage::ParquetDateInSecondsEncoder::encodeAndCopy ( const int8_t *  parquet_data_bytes,
int8_t *  omnisci_data_bytes 
)
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 34 of file ParquetDateInSecondsEncoder.h.

References kSecsPerDay.

35  {
36  const auto& parquet_data_value =
37  reinterpret_cast<const int32_t*>(parquet_data_bytes)[0];
38  auto& omnisci_data_value = reinterpret_cast<int64_t*>(omnisci_data_bytes)[0];
39  omnisci_data_value = parquet_data_value * kSecsPerDay;
40  }
static constexpr int64_t kSecsPerDay
void foreign_storage::ParquetDateInSecondsEncoder::validate ( std::shared_ptr< parquet::Statistics >  stats,
const SQLTypeInfo column_type 
) const
inlineoverridevirtual

Implements foreign_storage::ParquetMetadataValidator.

Definition at line 42 of file ParquetDateInSecondsEncoder.h.

References CHECK, SQLTypeInfo::get_compression(), foreign_storage::TypedParquetInPlaceEncoder< V, T >::getUnencodedStats(), SQLTypeInfo::is_date(), kENCODING_NONE, kSecsPerDay, and foreign_storage::DateInSecondsBoundsValidator< T >::validateValue().

43  {
44  CHECK(column_type.is_date());
45  if (column_type.get_compression() ==
46  kENCODING_NONE) { // do not validate NONE ENCODED dates as it is impossible for
47  // bounds to be exceeded (the conversion done for this case is
48  // from a date in days as a 32-bit integer to a date in seconds
49  // as a 64-bit integer)
50  return;
51  }
52  auto [unencoded_stats_min, unencoded_stats_max] =
55  unencoded_stats_max * kSecsPerDay, column_type);
57  unencoded_stats_min * kSecsPerDay, column_type);
58  }
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:322
#define CHECK(condition)
Definition: Logger.h:197
std::pair< T, T > getUnencodedStats(std::shared_ptr< parquet::Statistics > stats) const
bool is_date() const
Definition: sqltypes.h:730

+ Here is the call graph for this function:


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