OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 202 of file UpdelStorage.cpp.

Constructor & Destructor Documentation

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

Definition at line 210 of file UpdelStorage.cpp.

References column_data_, data_buffer_addr_, Chunk_NS::Chunk::getBuffer(), Chunk_NS::Chunk::getIndexBuf(), Data_Namespace::AbstractBuffer::getMemoryPtr(), and index_buffer_addr_.

211  : chunk_(chunk), column_descriptor_(chunk->getColumnDesc()) {
212  column_data_ = std::make_unique<std::vector<std::string>>(num_rows);
215  (StringOffsetT*)(chunk->getIndexBuf() ? chunk->getIndexBuf()->getMemoryPtr()
216  : nullptr);
217  }
AbstractBuffer * getIndexBuf() const
Definition: Chunk.h:148
virtual int8_t * getMemoryPtr()=0
int32_t StringOffsetT
Definition: sqltypes.h:1495
const ColumnDescriptor * getColumnDesc() const
Definition: Chunk.h:65
AbstractBuffer * getBuffer() const
Definition: Chunk.h:146
std::unique_ptr< std::vector< std::string > > column_data_
const ColumnDescriptor * column_descriptor_

+ Here is the call graph for this function:

Fragmenter_Namespace::StringChunkConverter::~StringChunkConverter ( )
inlineoverride

Definition at line 219 of file UpdelStorage.cpp.

219 {}

Member Function Documentation

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

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 228 of file UpdelStorage.cpp.

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

228  {
229  DataBlockPtr dataBlock;
230  dataBlock.stringsPtr = column_data_.get();
231  insertData.data.push_back(dataBlock);
232  insertData.columnIds.push_back(column_descriptor_->columnId);
233  }
std::vector< std::string > * stringsPtr
Definition: sqltypes.h:234
std::vector< DataBlockPtr > data
the number of rows being inserted
Definition: Fragmenter.h:73
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:71
void Fragmenter_Namespace::StringChunkConverter::convertToColumnarFormat ( size_t  row,
size_t  indexInFragment 
)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 221 of file UpdelStorage.cpp.

References data_buffer_addr_, and index_buffer_addr_.

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

Member Data Documentation

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

Definition at line 203 of file UpdelStorage.cpp.

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

Definition at line 206 of file UpdelStorage.cpp.

Referenced by addDataBlocksToInsertData(), and StringChunkConverter().

const ColumnDescriptor* Fragmenter_Namespace::StringChunkConverter::column_descriptor_

Definition at line 204 of file UpdelStorage.cpp.

Referenced by addDataBlocksToInsertData().

const int8_t* Fragmenter_Namespace::StringChunkConverter::data_buffer_addr_

Definition at line 207 of file UpdelStorage.cpp.

Referenced by convertToColumnarFormat(), and StringChunkConverter().

const StringOffsetT* Fragmenter_Namespace::StringChunkConverter::index_buffer_addr_

Definition at line 208 of file UpdelStorage.cpp.

Referenced by convertToColumnarFormat(), and StringChunkConverter().


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