OmniSciDB  2e3a973ef4
foreign_storage::ParquetDecimalEncoder< V, T > Class Template Reference

#include <ParquetDecimalEncoder.h>

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

Public Member Functions

 ParquetDecimalEncoder (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
 
- 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
 

Protected Member Functions

void encodeAndCopy (const int32_t &parquet_data_value, V &omnisci_data_value)
 
void encodeAndCopy (const int64_t &parquet_data_value, V &omnisci_data_value)
 
void encodeAndCopy (const parquet::FixedLenByteArray &parquet_data_value, V &omnisci_data_value)
 
void encodeAndCopy (const parquet::ByteArray &parquet_data_value, V &omnisci_data_value)
 
bool encodingIsIdentityForSameTypes () const override
 

Private Member Functions

int64_t convertDecimalByteArrayToInt (const uint8_t *byte_array, const int byte_array_size)
 

Private Attributes

const size_t parquet_column_type_length_
 

Additional Inherited Members

- 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::ParquetDecimalEncoder< V, T >

Definition at line 24 of file ParquetDecimalEncoder.h.

Constructor & Destructor Documentation

◆ ParquetDecimalEncoder()

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

Definition at line 26 of file ParquetDecimalEncoder.h.

29  : TypedParquetInPlaceEncoder<V, T>(buffer,
30  column_desciptor,
31  parquet_column_descriptor)
32  , parquet_column_type_length_(parquet_column_descriptor->type_length()) {}

Member Function Documentation

◆ convertDecimalByteArrayToInt()

template<typename V , typename T >
int64_t foreign_storage::ParquetDecimalEncoder< V, T >::convertDecimalByteArrayToInt ( const uint8_t *  byte_array,
const int  byte_array_size 
)
inlineprivate

Definition at line 65 of file ParquetDecimalEncoder.h.

References CHECK, and run_benchmark_import::result.

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

66  {
67  auto result = arrow::Decimal128::FromBigEndian(byte_array, byte_array_size);
68  CHECK(result.ok()) << result.status().message();
69  auto& decimal = result.ValueOrDie();
70  return static_cast<int64_t>(decimal);
71  }
#define CHECK(condition)
Definition: Logger.h:197
+ Here is the caller graph for this function:

◆ encodeAndCopy() [1/5]

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

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 34 of file ParquetDecimalEncoder.h.

35  {
36  const auto& parquet_data_value = reinterpret_cast<const T*>(parquet_data_bytes)[0];
37  auto& omnisci_data_value = reinterpret_cast<V*>(omnisci_data_bytes)[0];
38  encodeAndCopy(parquet_data_value, omnisci_data_value);
39  }
void encodeAndCopy(const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes) override

◆ encodeAndCopy() [2/5]

template<typename V , typename T >
void foreign_storage::ParquetDecimalEncoder< V, T >::encodeAndCopy ( const int32_t &  parquet_data_value,
V &  omnisci_data_value 
)
inlineprotected

Definition at line 42 of file ParquetDecimalEncoder.h.

42  {
43  omnisci_data_value = parquet_data_value;
44  }

◆ encodeAndCopy() [3/5]

template<typename V , typename T >
void foreign_storage::ParquetDecimalEncoder< V, T >::encodeAndCopy ( const int64_t &  parquet_data_value,
V &  omnisci_data_value 
)
inlineprotected

Definition at line 46 of file ParquetDecimalEncoder.h.

46  {
47  omnisci_data_value = parquet_data_value;
48  }

◆ encodeAndCopy() [4/5]

template<typename V , typename T >
void foreign_storage::ParquetDecimalEncoder< V, T >::encodeAndCopy ( const parquet::FixedLenByteArray &  parquet_data_value,
V &  omnisci_data_value 
)
inlineprotected

Definition at line 50 of file ParquetDecimalEncoder.h.

References foreign_storage::ParquetDecimalEncoder< V, T >::convertDecimalByteArrayToInt(), and foreign_storage::ParquetDecimalEncoder< V, T >::parquet_column_type_length_.

51  {
52  omnisci_data_value =
54  }
int64_t convertDecimalByteArrayToInt(const uint8_t *byte_array, const int byte_array_size)
+ Here is the call graph for this function:

◆ encodeAndCopy() [5/5]

template<typename V , typename T >
void foreign_storage::ParquetDecimalEncoder< V, T >::encodeAndCopy ( const parquet::ByteArray &  parquet_data_value,
V &  omnisci_data_value 
)
inlineprotected

Definition at line 56 of file ParquetDecimalEncoder.h.

References foreign_storage::ParquetDecimalEncoder< V, T >::convertDecimalByteArrayToInt().

57  {
58  omnisci_data_value =
59  convertDecimalByteArrayToInt(parquet_data_value.ptr, parquet_data_value.len);
60  }
int64_t convertDecimalByteArrayToInt(const uint8_t *byte_array, const int byte_array_size)
+ Here is the call graph for this function:

◆ encodingIsIdentityForSameTypes()

template<typename V , typename T >
bool foreign_storage::ParquetDecimalEncoder< V, T >::encodingIsIdentityForSameTypes ( ) const
inlineoverrideprotectedvirtual

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

Definition at line 62 of file ParquetDecimalEncoder.h.

62 { return true; }

Member Data Documentation

◆ parquet_column_type_length_

template<typename V , typename T >
const size_t foreign_storage::ParquetDecimalEncoder< V, T >::parquet_column_type_length_
private

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