OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE > Struct Template Reference
+ Inheritance diagram for Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >:
+ Collaboration diagram for Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >:

Public Types

using ColumnDataPtr = std::unique_ptr< INSERT_DATA_TYPE, CheckedMallocDeleter< INSERT_DATA_TYPE >>
 

Public Member Functions

 ScalarChunkConverter (const size_t num_rows, const Chunk_NS::Chunk *chunk)
 
 ~ScalarChunkConverter () override
 
void convertToColumnarFormat (size_t row, size_t indexInFragment) override
 
void addDataBlocksToInsertData (Fragmenter_Namespace::InsertData &insertData) override
 
- Public Member Functions inherited from Fragmenter_Namespace::ChunkToInsertDataConverter
virtual ~ChunkToInsertDataConverter ()
 

Public Attributes

const Chunk_NS::Chunkchunk_
 
ColumnDataPtr column_data_
 
const ColumnDescriptorcolumn_descriptor_
 
const BUFFER_DATA_TYPE * data_buffer_addr_
 

Detailed Description

template<typename BUFFER_DATA_TYPE, typename INSERT_DATA_TYPE>
struct Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >

Definition at line 145 of file UpdelStorage.cpp.

Member Typedef Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
using Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::ColumnDataPtr = std::unique_ptr<INSERT_DATA_TYPE, CheckedMallocDeleter<INSERT_DATA_TYPE>>

Definition at line 147 of file UpdelStorage.cpp.

Constructor & Destructor Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::ScalarChunkConverter ( const size_t  num_rows,
const Chunk_NS::Chunk chunk 
)
inline

Definition at line 154 of file UpdelStorage.cpp.

References checked_malloc(), Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_data_, Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::data_buffer_addr_, Chunk_NS::Chunk::get_buffer(), and Data_Namespace::AbstractBuffer::getMemoryPtr().

155  : chunk_(chunk), column_descriptor_(chunk->get_column_desc()) {
156  column_data_ = ColumnDataPtr(reinterpret_cast<INSERT_DATA_TYPE*>(
157  checked_malloc(num_rows * sizeof(INSERT_DATA_TYPE))));
158  data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->get_buffer()->getMemoryPtr();
159  }
const ColumnDescriptor * get_column_desc() const
Definition: Chunk.h:52
const int8_t const int64_t * num_rows
const ColumnDescriptor * column_descriptor_
virtual int8_t * getMemoryPtr()=0
AbstractBuffer * get_buffer() const
Definition: Chunk.h:94
void * checked_malloc(const size_t size)
Definition: checked_alloc.h:40
const BUFFER_DATA_TYPE * data_buffer_addr_
std::unique_ptr< INSERT_DATA_TYPE, CheckedMallocDeleter< INSERT_DATA_TYPE >> ColumnDataPtr

+ Here is the call graph for this function:

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::~ScalarChunkConverter ( )
inlineoverride

Definition at line 161 of file UpdelStorage.cpp.

161 {}

Member Function Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
void Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::addDataBlocksToInsertData ( Fragmenter_Namespace::InsertData insertData)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 169 of file UpdelStorage.cpp.

References Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_data_, Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_descriptor_, ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, and DataBlockPtr::numbersPtr.

169  {
170  DataBlockPtr dataBlock;
171  dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get());
172  insertData.data.push_back(dataBlock);
173  insertData.columnIds.push_back(column_descriptor_->columnId);
174  }
const ColumnDescriptor * column_descriptor_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:64
int8_t * numbersPtr
Definition: sqltypes.h:140
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:62
template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
void Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::convertToColumnarFormat ( size_t  row,
size_t  indexInFragment 
)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 163 of file UpdelStorage.cpp.

References Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_data_, and Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::data_buffer_addr_.

163  {
164  auto buffer_value = data_buffer_addr_[indexInFragment];
165  auto insert_value = static_cast<INSERT_DATA_TYPE>(buffer_value);
166  column_data_.get()[row] = insert_value;
167  }
const BUFFER_DATA_TYPE * data_buffer_addr_

Member Data Documentation

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
const Chunk_NS::Chunk* Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::chunk_

Definition at line 149 of file UpdelStorage.cpp.

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
const ColumnDescriptor* Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_descriptor_
template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
const BUFFER_DATA_TYPE* Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::data_buffer_addr_

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