OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext Class Reference
+ Inheritance diagram for Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext:
+ Collaboration diagram for Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext:

Public Member Functions

 NonGeoAlterColumnContext (int device_id, const ChunkKey &chunk_key_prefix, Fragmenter_Namespace::FragmentInfo *fragment_info, const ColumnDescriptor *src_cd, const ColumnDescriptor *dst_cd, const size_t num_elements, Data_Namespace::DataMgr *data_mgr, Catalog_Namespace::Catalog *catalog_, std::map< int, Chunk_NS::Chunk > &column_map)
 
void createScratchBuffers ()
 
void deleteScratchBuffers ()
 
void reencodeData ()
 
void putBuffersToDisk ()
 
- Public Member Functions inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
 BaseAlterColumnContext (int device_id, const ChunkKey &chunk_key_prefix, Fragmenter_Namespace::FragmentInfo *fragment_info, const ColumnDescriptor *src_cd, const ColumnDescriptor *dst_cd, const size_t num_elements, Data_Namespace::DataMgr *data_mgr, Catalog_Namespace::Catalog *catalog, std::map< int, Chunk_NS::Chunk > &column_map)
 
void readSourceData ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
static void unpinChunk (Chunk &chunk)
 
- Protected Member Functions inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
void createChunkScratchBuffer (Chunk_NS::Chunk &chunk)
 
void freeChunkScratchBuffer (Chunk_NS::Chunk &chunk)
 
- Protected Attributes inherited from Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::BaseAlterColumnContext
int device_id_
 
const ChunkKeychunk_key_prefix_
 
Fragmenter_Namespace::FragmentInfofragment_info_
 
const ColumnDescriptorsrc_cd_
 
const ColumnDescriptordst_cd_
 
const size_t num_elements_
 
Data_Namespace::DataMgrdata_mgr_
 
Catalog_Namespace::Catalogcatalog_
 
std::map< int, Chunk_NS::Chunk > & column_map_
 
data_conversion::ConversionFactoryParam param_
 
std::unique_ptr
< data_conversion::BaseSource
source
 
AbstractBufferbuffer_
 
AbstractBufferindex_buffer_
 
Chunk_NS::Chunk disk_level_src_chunk_
 
Chunk_NS::Chunk mem_level_src_chunk_
 
ChunkKey key_
 
const int8_t * src_data_
 
ArrayElemTypeChunk scalar_temp_chunk_
 

Detailed Description

Definition at line 330 of file InsertOrderFragmenter.cpp.

Constructor & Destructor Documentation

Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext::NonGeoAlterColumnContext ( int  device_id,
const ChunkKey chunk_key_prefix,
Fragmenter_Namespace::FragmentInfo fragment_info,
const ColumnDescriptor src_cd,
const ColumnDescriptor dst_cd,
const size_t  num_elements,
Data_Namespace::DataMgr data_mgr,
Catalog_Namespace::Catalog catalog_,
std::map< int, Chunk_NS::Chunk > &  column_map 
)
inline

Definition at line 332 of file InsertOrderFragmenter.cpp.

341  : BaseAlterColumnContext(device_id,
342  chunk_key_prefix,
343  fragment_info,
344  src_cd,
345  dst_cd,
346  num_elements,
347  data_mgr,
348  catalog_,
349  column_map) {}
BaseAlterColumnContext(int device_id, const ChunkKey &chunk_key_prefix, Fragmenter_Namespace::FragmentInfo *fragment_info, const ColumnDescriptor *src_cd, const ColumnDescriptor *dst_cd, const size_t num_elements, Data_Namespace::DataMgr *data_mgr, Catalog_Namespace::Catalog *catalog, std::map< int, Chunk_NS::Chunk > &column_map)

Member Function Documentation

void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext::createScratchBuffers ( )
inline

Definition at line 351 of file InsertOrderFragmenter.cpp.

References Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::create_array_elem_type_chunk().

351  {
352  auto db_id = catalog_->getDatabaseId();
353  param_.db_id = db_id;
355  if (dst_cd_->columnType.is_array()) {
358  }
359 
360  auto& dst_chunk = param_.dst_chunk;
361 
362  createChunkScratchBuffer(dst_chunk);
363 
364  if (dst_cd_->columnType.is_array()) {
366  }
367 
368  buffer_ = dst_chunk.getBuffer();
369  index_buffer_ = dst_chunk.getIndexBuf(); // nullptr for non-varlen types
370  }
int getDatabaseId() const
Definition: Catalog.h:326
void create_array_elem_type_chunk(ArrayElemTypeChunk &array_chunk, const ColumnDescriptor *array_cd)
SQLTypeInfo columnType
bool is_array() const
Definition: sqltypes.h:585

+ Here is the call graph for this function:

void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext::deleteScratchBuffers ( )
inline
void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext::putBuffersToDisk ( )
inline

Definition at line 410 of file InsertOrderFragmenter.cpp.

References data_mgr_(), and Chunk_NS::Chunk::setBuffer().

410  {
412  auto data_key = key_;
413  data_key.push_back(1);
414  auto index_key = key_;
415  index_key.push_back(2);
416 
417  Chunk fragmenter_chunk{dst_cd_, false};
418  fragmenter_chunk.setBuffer(
420  fragmenter_chunk.setIndexBuffer(
422  column_map_[src_cd_->columnId] = fragmenter_chunk;
423 
424  } else {
425  Chunk fragmenter_chunk{dst_cd_, false};
426  fragmenter_chunk.setBuffer(data_mgr_->getGlobalFileMgr()->putBuffer(key_, buffer_));
427  column_map_[src_cd_->columnId] = fragmenter_chunk;
428  }
429  }
AbstractBuffer * putBuffer(const ChunkKey &key, AbstractBuffer *d, const size_t numBytes=0) override
Puts the contents of d into the Chunk with the given key.
File_Namespace::GlobalFileMgr * getGlobalFileMgr() const
Definition: DataMgr.cpp:699
SQLTypeInfo columnType
bool is_varlen_indeed() const
Definition: sqltypes.h:637

+ Here is the call graph for this function:

void Fragmenter_Namespace::anonymous_namespace{InsertOrderFragmenter.cpp}::NonGeoAlterColumnContext::reencodeData ( )
inline

Definition at line 379 of file InsertOrderFragmenter.cpp.

References data_conversion::create_string_view_encoder().

379  {
380  auto& dst_chunk = param_.dst_chunk;
381  disk_level_src_chunk_.getBuffer()->syncEncoder(dst_chunk.getBuffer());
382  if (disk_level_src_chunk_.getIndexBuf() && dst_chunk.getIndexBuf()) {
383  disk_level_src_chunk_.getIndexBuf()->syncEncoder(dst_chunk.getIndexBuf());
384  }
385 
386  dst_chunk.initEncoder();
387 
388  auto convert_encoder =
389  data_conversion::create_string_view_encoder(param_, false, false); // not geo
390 
391  try {
392  convert_encoder->encodeAndAppendData(src_data_, num_elements_);
393  convert_encoder->finalize(num_elements_);
394  } catch (std::exception& except) {
395  throw std::runtime_error("Column " + src_cd_->columnName + ": " + except.what());
396  }
397 
398  auto metadata = convert_encoder->getMetadata(
400 
401  buffer_->getEncoder()->resetChunkStats(metadata->chunkStats);
403 
404  buffer_->setUpdated();
405  if (index_buffer_) {
407  }
408  }
AbstractBuffer * getIndexBuf() const
Definition: Chunk.h:148
void syncEncoder(const AbstractBuffer *src_buffer)
std::unique_ptr< BaseConvertEncoder > create_string_view_encoder(ConversionFactoryParam &param, const bool error_tracking_enabled, const bool geo_validate_geometry)
void setNumElems(const size_t num_elems)
Definition: Encoder.h:285
virtual bool resetChunkStats(const ChunkStats &)
: Reset chunk level stats (min, max, nulls) using new values from the argument.
Definition: Encoder.h:274
AbstractBuffer * getBuffer() const
Definition: Chunk.h:146
SQLTypeInfo columnType
std::string columnName
bool is_array() const
Definition: sqltypes.h:585

+ Here is the call graph for this function:


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