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

Constructor & Destructor Documentation

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

Definition at line 242 of file UpdelStorage.cpp.

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

243  : chunk_(chunk), column_descriptor_(chunk->get_column_desc()) {
244  column_data_ = std::make_unique<std::vector<std::string>>(num_rows);
247  (StringOffsetT*)(chunk->get_index_buf() ? chunk->get_index_buf()->getMemoryPtr()
248  : nullptr);
249  }
AbstractBuffer * get_index_buf() const
Definition: Chunk.h:95
const ColumnDescriptor * get_column_desc() const
Definition: Chunk.h:52
const int8_t const int64_t * num_rows
virtual int8_t * getMemoryPtr()=0
AbstractBuffer * get_buffer() const
Definition: Chunk.h:94
int32_t StringOffsetT
Definition: sqltypes.h:912
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 251 of file UpdelStorage.cpp.

251 {}

Member Function Documentation

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

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 260 of file UpdelStorage.cpp.

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

260  {
261  DataBlockPtr dataBlock;
262  dataBlock.stringsPtr = column_data_.get();
263  insertData.data.push_back(dataBlock);
264  insertData.columnIds.push_back(column_descriptor_->columnId);
265  }
std::vector< std::string > * stringsPtr
Definition: sqltypes.h:141
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
void Fragmenter_Namespace::StringChunkConverter::convertToColumnarFormat ( size_t  row,
size_t  indexInFragment 
)
inlineoverridevirtual

Implements Fragmenter_Namespace::ChunkToInsertDataConverter.

Definition at line 253 of file UpdelStorage.cpp.

References data_buffer_addr_, and index_buffer_addr_.

253  {
254  size_t src_value_size =
255  index_buffer_addr_[indexInFragment + 1] - index_buffer_addr_[indexInFragment];
256  auto src_value_ptr = data_buffer_addr_ + index_buffer_addr_[indexInFragment];
257  (*column_data_)[row] = std::string((const char*)src_value_ptr, src_value_size);
258  }

Member Data Documentation

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

Definition at line 235 of file UpdelStorage.cpp.

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

Definition at line 238 of file UpdelStorage.cpp.

Referenced by addDataBlocksToInsertData(), and StringChunkConverter().

const ColumnDescriptor* Fragmenter_Namespace::StringChunkConverter::column_descriptor_

Definition at line 236 of file UpdelStorage.cpp.

Referenced by addDataBlocksToInsertData().

const int8_t* Fragmenter_Namespace::StringChunkConverter::data_buffer_addr_

Definition at line 239 of file UpdelStorage.cpp.

Referenced by convertToColumnarFormat(), and StringChunkConverter().

const StringOffsetT* Fragmenter_Namespace::StringChunkConverter::index_buffer_addr_

Definition at line 240 of file UpdelStorage.cpp.

Referenced by convertToColumnarFormat(), and StringChunkConverter().


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