OmniSciDB  baf940c279
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 201 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 209 of file UpdelStorage.cpp.

References Chunk_NS::Chunk::getBuffer(), Chunk_NS::Chunk::getIndexBuf(), Data_Namespace::AbstractBuffer::getMemoryPtr(), and num_rows.

210  : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) {
211  column_data_ = std::make_unique<std::vector<std::string>>(num_rows);
214  (StringOffsetT*)(chunk->getIndexBuf() ? chunk->getIndexBuf()->getMemoryPtr()
215  : nullptr);
216  }
const int8_t const int64_t * num_rows
AbstractBuffer * getBuffer() const
Definition: Chunk.h:104
virtual int8_t * getMemoryPtr()=0
AbstractBuffer * getIndexBuf() const
Definition: Chunk.h:106
int32_t StringOffsetT
Definition: sqltypes.h:868
std::unique_ptr< std::vector< std::string > > column_data_
const ColumnDescriptor * getColumnDesc() const
Definition: Chunk.h:53
const ColumnDescriptor * column_descriptor_
+ Here is the call graph for this function:

◆ ~StringChunkConverter()

Fragmenter_Namespace::StringChunkConverter::~StringChunkConverter ( )
inlineoverride

Definition at line 218 of file UpdelStorage.cpp.

218 {}

Member Function Documentation

◆ addDataBlocksToInsertData()

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

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 227 of file UpdelStorage.cpp.

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

227  {
228  DataBlockPtr dataBlock;
229  dataBlock.stringsPtr = column_data_.get();
230  insertData.data.push_back(dataBlock);
231  insertData.columnIds.push_back(column_descriptor_->columnId);
232  }
std::vector< std::string > * stringsPtr
Definition: sqltypes.h:150
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 220 of file UpdelStorage.cpp.

220  {
221  size_t src_value_size =
222  index_buffer_addr_[indexInFragment + 1] - index_buffer_addr_[indexInFragment];
223  auto src_value_ptr = data_buffer_addr_ + index_buffer_addr_[indexInFragment];
224  (*column_data_)[row] = std::string((const char*)src_value_ptr, src_value_size);
225  }

Member Data Documentation

◆ chunk_

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

Definition at line 202 of file UpdelStorage.cpp.

◆ column_data_

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

Definition at line 205 of file UpdelStorage.cpp.

◆ column_descriptor_

const ColumnDescriptor* Fragmenter_Namespace::StringChunkConverter::column_descriptor_

Definition at line 203 of file UpdelStorage.cpp.

◆ data_buffer_addr_

const int8_t* Fragmenter_Namespace::StringChunkConverter::data_buffer_addr_

Definition at line 206 of file UpdelStorage.cpp.

◆ index_buffer_addr_

const StringOffsetT* Fragmenter_Namespace::StringChunkConverter::index_buffer_addr_

Definition at line 207 of file UpdelStorage.cpp.


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