OmniSciDB  c07336695a
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 142 of file UpdelStorage.cpp.

Member Typedef Documentation

◆ ColumnDataPtr

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 144 of file UpdelStorage.cpp.

Constructor & Destructor Documentation

◆ ScalarChunkConverter()

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 151 of file UpdelStorage.cpp.

References checked_malloc(), Chunk_NS::Chunk::get_buffer(), and Data_Namespace::AbstractBuffer::getMemoryPtr().

152  : chunk_(chunk), column_descriptor_(chunk->get_column_desc()) {
153  column_data_ = ColumnDataPtr(reinterpret_cast<INSERT_DATA_TYPE*>(
154  checked_malloc(num_rows * sizeof(INSERT_DATA_TYPE))));
155  data_buffer_addr_ = (BUFFER_DATA_TYPE*)chunk->get_buffer()->getMemoryPtr();
156  }
const int8_t const int64_t * num_rows
const ColumnDescriptor * get_column_desc() const
Definition: Chunk.h:52
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
std::unique_ptr< INSERT_DATA_TYPE, CheckedMallocDeleter< INSERT_DATA_TYPE > > ColumnDataPtr
const BUFFER_DATA_TYPE * data_buffer_addr_
+ Here is the call graph for this function:

◆ ~ScalarChunkConverter()

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

Definition at line 158 of file UpdelStorage.cpp.

158 {}

Member Function Documentation

◆ addDataBlocksToInsertData()

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 166 of file UpdelStorage.cpp.

References ColumnDescriptor::columnId, Fragmenter_Namespace::InsertData::columnIds, Fragmenter_Namespace::InsertData::data, and DataBlockPtr::numbersPtr.

166  {
167  DataBlockPtr dataBlock;
168  dataBlock.numbersPtr = reinterpret_cast<int8_t*>(column_data_.get());
169  insertData.data.push_back(dataBlock);
170  insertData.columnIds.push_back(column_descriptor_->columnId);
171  }
const ColumnDescriptor * column_descriptor_
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:64
int8_t * numbersPtr
Definition: sqltypes.h:137
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:62

◆ convertToColumnarFormat()

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 160 of file UpdelStorage.cpp.

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

Member Data Documentation

◆ chunk_

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 146 of file UpdelStorage.cpp.

◆ column_data_

template<typename BUFFER_DATA_TYPE , typename INSERT_DATA_TYPE >
ColumnDataPtr Fragmenter_Namespace::ScalarChunkConverter< BUFFER_DATA_TYPE, INSERT_DATA_TYPE >::column_data_

Definition at line 147 of file UpdelStorage.cpp.

◆ column_descriptor_

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

Definition at line 148 of file UpdelStorage.cpp.

◆ data_buffer_addr_

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_

Definition at line 149 of file UpdelStorage.cpp.


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