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

#include <ParquetInPlaceEncoder.h>

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

Public Member Functions

 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)
 
virtual void encodeAndCopy (const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes)=0
 
- Public Member Functions inherited from foreign_storage::ParquetEncoder
 ParquetEncoder (Data_Namespace::AbstractBuffer *buffer)
 
virtual ~ParquetEncoder ()=default
 

Protected Member Functions

virtual bool encodingIsIdentityForSameTypes () const
 

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

Definition at line 140 of file ParquetInPlaceEncoder.h.

Constructor & Destructor Documentation

◆ TypedParquetInPlaceEncoder() [1/2]

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

Definition at line 142 of file ParquetInPlaceEncoder.h.

146  buffer,
147  column_desciptor->columnType.get_size(),
148  parquet::GetTypeByteSize(parquet_column_descriptor->physical_type())) {}
ParquetInPlaceEncoder(Data_Namespace::AbstractBuffer *buffer, const size_t omnisci_data_type_byte_size, const size_t parquet_data_type_byte_size)
HOST DEVICE int get_size() const
Definition: sqltypes.h:269
SQLTypeInfo columnType

◆ TypedParquetInPlaceEncoder() [2/2]

template<typename V, typename T>
foreign_storage::TypedParquetInPlaceEncoder< V, T >::TypedParquetInPlaceEncoder ( Data_Namespace::AbstractBuffer buffer,
const size_t  omnisci_data_type_byte_size,
const size_t  parquet_data_type_byte_size 
)
inline

Definition at line 150 of file ParquetInPlaceEncoder.h.

153  : ParquetInPlaceEncoder(buffer,
154  omnisci_data_type_byte_size,
155  parquet_data_type_byte_size) {}
ParquetInPlaceEncoder(Data_Namespace::AbstractBuffer *buffer, const size_t omnisci_data_type_byte_size, const size_t parquet_data_type_byte_size)

Member Function Documentation

◆ appendData()

template<typename V, typename T>
void foreign_storage::TypedParquetInPlaceEncoder< V, T >::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 
)
inlineoverridevirtual

This is a specialization of ParquetInPlaceEncoder::appendData for known types that allows for optimization.

See comment for ParquetInPlaceEncoder::appendData for details.

Reimplemented from foreign_storage::ParquetInPlaceEncoder.

Definition at line 163 of file ParquetInPlaceEncoder.h.

Referenced by foreign_storage::ParquetStringEncoder< V >::appendData().

168  {
169  if (std::is_same<V, T>::value && values_read == levels_read) {
171  for (int64_t i = 0; i < levels_read; ++i) {
173  values + i * omnisci_data_type_byte_size_);
174  }
175  }
176  buffer_->append(values, levels_read * omnisci_data_type_byte_size_);
177  } else {
179  def_levels, rep_levels, values_read, levels_read, is_last_batch, values);
180  }
181  }
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
virtual void encodeAndCopy(const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes)=0
virtual void append(int8_t *src, const size_t num_bytes, const MemoryLevel src_buffer_type=CPU_LEVEL, const int device_id=-1)=0
Data_Namespace::AbstractBuffer * buffer_
+ Here is the caller graph for this function:

◆ copy()

template<typename V, typename T>
void foreign_storage::TypedParquetInPlaceEncoder< V, T >::copy ( const int8_t *  omnisci_data_bytes_source,
int8_t *  omnisci_data_bytes_destination 
)
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 199 of file ParquetInPlaceEncoder.h.

Referenced by foreign_storage::ParquetStringEncoder< V >::encodeAndCopy().

200  {
201  const auto& omnisci_data_value_source =
202  reinterpret_cast<const V*>(omnisci_data_bytes_source)[0];
203  auto& omnisci_data_value_destination =
204  reinterpret_cast<V*>(omnisci_data_bytes_destination)[0];
205  omnisci_data_value_destination = omnisci_data_value_source;
206  }
+ Here is the caller graph for this function:

◆ encodeAndCopyContiguous()

template<typename V, typename T>
void foreign_storage::TypedParquetInPlaceEncoder< V, T >::encodeAndCopyContiguous ( const int8_t *  parquet_data_bytes,
int8_t *  omnisci_data_bytes,
const size_t  num_elements 
)
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 183 of file ParquetInPlaceEncoder.h.

185  {
186  auto parquet_data_ptr = reinterpret_cast<const T*>(parquet_data_bytes);
187  auto omnisci_data_ptr = reinterpret_cast<V*>(omnisci_data_bytes);
188  for (size_t i = 0; i < num_elements; ++i) {
189  encodeAndCopy(reinterpret_cast<const int8_t*>(&parquet_data_ptr[i]),
190  reinterpret_cast<int8_t*>(&omnisci_data_ptr[i]));
191  }
192  }
virtual void encodeAndCopy(const int8_t *parquet_data_bytes, int8_t *omnisci_data_bytes)=0

◆ encodingIsIdentityForSameTypes()

template<typename V, typename T>
virtual bool foreign_storage::TypedParquetInPlaceEncoder< V, T >::encodingIsIdentityForSameTypes ( ) const
inlineprotectedvirtual

◆ setNull()

template<typename V, typename T>
void foreign_storage::TypedParquetInPlaceEncoder< V, T >::setNull ( int8_t *  omnisci_data_bytes)
inlineoverridevirtual

Implements foreign_storage::ParquetScalarEncoder.

Definition at line 194 of file ParquetInPlaceEncoder.h.

194  {
195  auto& omnisci_data_value = reinterpret_cast<V*>(omnisci_data_bytes)[0];
196  omnisci_data_value = get_null_value<V>();
197  }

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