OmniSciDB  c07336695a
Fragmenter_Namespace::StringChunkConverter Struct Reference
+ Inheritance diagram for Fragmenter_Namespace::StringChunkConverter:
+ Collaboration diagram for Fragmenter_Namespace::StringChunkConverter:

Public Member Functions

 StringChunkConverter (size_t num_rows, const Chunk_NS::Chunk *chunk)
 
 ~StringChunkConverter () 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_
 
const ColumnDescriptorcolumn_descriptor_
 
std::unique_ptr< std::vector< std::string > > column_data_
 
const int8_t * data_buffer_addr_
 
const StringOffsetTindex_buffer_addr_
 

Detailed Description

Definition at line 226 of file UpdelStorage.cpp.

Constructor & Destructor Documentation

◆ StringChunkConverter()

Fragmenter_Namespace::StringChunkConverter::StringChunkConverter ( size_t  num_rows,
const Chunk_NS::Chunk chunk 
)
inline

Definition at line 234 of file UpdelStorage.cpp.

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

235  : chunk_(chunk), column_descriptor_(chunk->get_column_desc()) {
236  column_data_ = std::make_unique<std::vector<std::string>>(num_rows);
239  (StringOffsetT*)(chunk->get_index_buf() ? chunk->get_index_buf()->getMemoryPtr()
240  : nullptr);
241  }
const int8_t const int64_t * num_rows
const ColumnDescriptor * get_column_desc() const
Definition: Chunk.h:52
AbstractBuffer * get_index_buf() const
Definition: Chunk.h:95
virtual int8_t * getMemoryPtr()=0
AbstractBuffer * get_buffer() const
Definition: Chunk.h:94
int32_t StringOffsetT
Definition: sqltypes.h:873
std::unique_ptr< std::vector< std::string > > column_data_
const ColumnDescriptor * column_descriptor_
+ Here is the call graph for this function:

◆ ~StringChunkConverter()

Fragmenter_Namespace::StringChunkConverter::~StringChunkConverter ( )
inlineoverride

Definition at line 243 of file UpdelStorage.cpp.

243 {}

Member Function Documentation

◆ addDataBlocksToInsertData()

void Fragmenter_Namespace::StringChunkConverter::addDataBlocksToInsertData ( Fragmenter_Namespace::InsertData insertData)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 252 of file UpdelStorage.cpp.

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

252  {
253  DataBlockPtr dataBlock;
254  dataBlock.stringsPtr = column_data_.get();
255  insertData.data.push_back(dataBlock);
256  insertData.columnIds.push_back(column_descriptor_->columnId);
257  }
std::vector< std::string > * stringsPtr
Definition: sqltypes.h:138
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:64
std::unique_ptr< std::vector< std::string > > column_data_
const ColumnDescriptor * column_descriptor_
std::vector< int > columnIds
identifies the table into which the data is being inserted
Definition: Fragmenter.h:62

◆ convertToColumnarFormat()

void Fragmenter_Namespace::StringChunkConverter::convertToColumnarFormat ( size_t  row,
size_t  indexInFragment 
)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 245 of file UpdelStorage.cpp.

245  {
246  size_t src_value_size =
247  index_buffer_addr_[indexInFragment + 1] - index_buffer_addr_[indexInFragment];
248  auto src_value_ptr = data_buffer_addr_ + index_buffer_addr_[indexInFragment];
249  (*column_data_)[row] = std::string((const char*)src_value_ptr, src_value_size);
250  }

Member Data Documentation

◆ chunk_

const Chunk_NS::Chunk* Fragmenter_Namespace::StringChunkConverter::chunk_

Definition at line 227 of file UpdelStorage.cpp.

◆ column_data_

std::unique_ptr<std::vector<std::string> > Fragmenter_Namespace::StringChunkConverter::column_data_

Definition at line 230 of file UpdelStorage.cpp.

◆ column_descriptor_

const ColumnDescriptor* Fragmenter_Namespace::StringChunkConverter::column_descriptor_

Definition at line 228 of file UpdelStorage.cpp.

◆ data_buffer_addr_

const int8_t* Fragmenter_Namespace::StringChunkConverter::data_buffer_addr_

Definition at line 231 of file UpdelStorage.cpp.

◆ index_buffer_addr_

const StringOffsetT* Fragmenter_Namespace::StringChunkConverter::index_buffer_addr_

Definition at line 232 of file UpdelStorage.cpp.


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