OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foreign_storage::csv_file_buffer_parser::ParseBufferRequest Struct Reference

#include <CsvFileBufferParser.h>

+ Collaboration diagram for foreign_storage::csv_file_buffer_parser::ParseBufferRequest:

Public Member Functions

 ParseBufferRequest (const ParseBufferRequest &request)=delete
 
 ParseBufferRequest (ParseBufferRequest &&request)=default
 
 ParseBufferRequest (size_t buffer_size, const import_export::CopyParams &copy_params, int db_id, const ForeignTable *foreign_table, std::set< int > column_filter_set)
 
std::shared_ptr
< Catalog_Namespace::Catalog
getCatalog () const
 
std::list< const
ColumnDescriptor * > 
getColumns () const
 
int32_t getTableId () const
 
std::string getTableName () const
 
size_t getMaxFragRows () const
 
std::string getFilePath () const
 

Public Attributes

std::unique_ptr< char[]> buffer
 
size_t buffer_size
 
size_t buffer_alloc_size
 
const import_export::CopyParams copy_params
 
const int db_id
 
std::unique_ptr
< ForeignTableSchema
foreign_table_schema
 
std::vector< std::unique_ptr
< import_export::TypedImportBuffer > > 
import_buffers
 
size_t buffer_row_count
 
size_t begin_pos
 
size_t end_pos
 
size_t first_row_index
 
size_t file_offset
 
size_t process_row_count
 

Detailed Description

Definition at line 253 of file CsvFileBufferParser.h.

Constructor & Destructor Documentation

foreign_storage::csv_file_buffer_parser::ParseBufferRequest::ParseBufferRequest ( const ParseBufferRequest request)
delete
foreign_storage::csv_file_buffer_parser::ParseBufferRequest::ParseBufferRequest ( ParseBufferRequest &&  request)
default
foreign_storage::csv_file_buffer_parser::ParseBufferRequest::ParseBufferRequest ( size_t  buffer_size,
const import_export::CopyParams copy_params,
int  db_id,
const ForeignTable foreign_table,
std::set< int >  column_filter_set 
)
inline

Definition at line 256 of file CsvFileBufferParser.h.

References getCatalog(), getColumns(), import_buffers, IS_STRING, and kENCODING_DICT.

261  : buffer(std::make_unique<char[]>(buffer_size))
264  , copy_params(copy_params)
265  , db_id(db_id)
266  , foreign_table_schema(std::make_unique<ForeignTableSchema>(db_id, foreign_table)) {
267  // initialize import buffers from columns.
268  for (const auto column : getColumns()) {
269  if (column_filter_set.find(column->columnId) == column_filter_set.end()) {
270  import_buffers.emplace_back(nullptr);
271  } else {
272  StringDictionary* string_dictionary = nullptr;
273  if (column->columnType.is_dict_encoded_string() ||
274  (column->columnType.is_array() &&
275  IS_STRING(column->columnType.get_subtype()) &&
276  column->columnType.get_compression() == kENCODING_DICT)) {
277  auto dict_descriptor = getCatalog()->getMetadataForDictUnlocked(
278  column->columnType.get_comp_param(), true);
279  string_dictionary = dict_descriptor->stringDict.get();
280  }
281  import_buffers.emplace_back(std::make_unique<import_export::TypedImportBuffer>(
282  column, string_dictionary));
283  }
284  }
285  }
std::vector< std::unique_ptr< import_export::TypedImportBuffer > > import_buffers
std::list< const ColumnDescriptor * > getColumns() const
std::shared_ptr< Catalog_Namespace::Catalog > getCatalog() const
#define IS_STRING(T)
Definition: sqltypes.h:241

+ Here is the call graph for this function:

Member Function Documentation

std::shared_ptr<Catalog_Namespace::Catalog> foreign_storage::csv_file_buffer_parser::ParseBufferRequest::getCatalog ( ) const
inline

Definition at line 287 of file CsvFileBufferParser.h.

References Catalog_Namespace::SysCatalog::checkedGetCatalog(), db_id, and Catalog_Namespace::SysCatalog::instance().

Referenced by foreign_storage::csv_file_buffer_parser::parse_buffer(), and ParseBufferRequest().

287  {
289  }
static SysCatalog & instance()
Definition: SysCatalog.h:288
std::shared_ptr< Catalog > checkedGetCatalog(const int32_t db_id)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::list<const ColumnDescriptor*> foreign_storage::csv_file_buffer_parser::ParseBufferRequest::getColumns ( ) const
inline

Definition at line 291 of file CsvFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::csv_file_buffer_parser::parse_buffer(), and ParseBufferRequest().

291  {
292  return foreign_table_schema->getLogicalAndPhysicalColumns();
293  }

+ Here is the caller graph for this function:

std::string foreign_storage::csv_file_buffer_parser::ParseBufferRequest::getFilePath ( ) const
inline

Definition at line 307 of file CsvFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::csv_file_buffer_parser::parse_buffer(), and foreign_storage::process_data_blocks().

307  {
308  return foreign_table_schema->getForeignTable()->getFullFilePath();
309  }

+ Here is the caller graph for this function:

size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::getMaxFragRows ( ) const
inline

Definition at line 303 of file CsvFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::process_data_blocks().

303  {
304  return foreign_table_schema->getForeignTable()->maxFragRows;
305  }

+ Here is the caller graph for this function:

int32_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::getTableId ( ) const
inline

Definition at line 295 of file CsvFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::process_data_blocks().

295  {
296  return foreign_table_schema->getForeignTable()->tableId;
297  }

+ Here is the caller graph for this function:

std::string foreign_storage::csv_file_buffer_parser::ParseBufferRequest::getTableName ( ) const
inline

Definition at line 299 of file CsvFileBufferParser.h.

References foreign_table_schema.

299  {
300  return foreign_table_schema->getForeignTable()->tableName;
301  }

Member Data Documentation

size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::begin_pos
std::unique_ptr<char[]> foreign_storage::csv_file_buffer_parser::ParseBufferRequest::buffer
size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::buffer_alloc_size

Definition at line 314 of file CsvFileBufferParser.h.

size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::buffer_row_count

Definition at line 321 of file CsvFileBufferParser.h.

size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::buffer_size
size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::end_pos
size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::file_offset
size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::first_row_index
std::unique_ptr<ForeignTableSchema> foreign_storage::csv_file_buffer_parser::ParseBufferRequest::foreign_table_schema
std::vector<std::unique_ptr<import_export::TypedImportBuffer> > foreign_storage::csv_file_buffer_parser::ParseBufferRequest::import_buffers
size_t foreign_storage::csv_file_buffer_parser::ParseBufferRequest::process_row_count

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