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

#include <TextFileBufferParser.h>

+ Collaboration diagram for foreign_storage::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, const std::set< int > column_filter_set, const std::string &full_path, const RenderGroupAnalyzerMap *render_group_analyzer_map, const bool track_rejected_rows=false)
 
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
 
const RenderGroupAnalyzerMaprender_group_analyzer_map
 
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
 
std::string full_path
 
const bool track_rejected_rows
 
size_t processed_row_count
 

Detailed Description

Definition at line 27 of file TextFileBufferParser.h.

Constructor & Destructor Documentation

foreign_storage::ParseBufferRequest::ParseBufferRequest ( const ParseBufferRequest request)
delete
foreign_storage::ParseBufferRequest::ParseBufferRequest ( ParseBufferRequest &&  request)
default
foreign_storage::ParseBufferRequest::ParseBufferRequest ( size_t  buffer_size,
const import_export::CopyParams copy_params,
int  db_id,
const ForeignTable foreign_table,
const std::set< int >  column_filter_set,
const std::string &  full_path,
const RenderGroupAnalyzerMap render_group_analyzer_map,
const bool  track_rejected_rows = false 
)

Definition at line 23 of file TextFileBufferParser.cpp.

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

34  , copy_params(copy_params)
35  , db_id(db_id)
36  , foreign_table_schema(std::make_unique<ForeignTableSchema>(db_id, foreign_table))
40  if (buffer_size > 0) {
41  buffer = std::make_unique<char[]>(buffer_size);
42  }
43  // initialize import buffers from columns.
44  for (const auto column : getColumns()) {
45  if (column_filter_set.find(column->columnId) == column_filter_set.end()) {
46  import_buffers.emplace_back(nullptr);
47  } else {
48  StringDictionary* string_dictionary = nullptr;
49  if (column->columnType.is_dict_encoded_string() ||
50  (column->columnType.is_array() && IS_STRING(column->columnType.get_subtype()) &&
51  column->columnType.get_compression() == kENCODING_DICT)) {
52  auto dict_descriptor =
53  getCatalog()->getMetadataForDict(column->columnType.get_comp_param(), true);
54  string_dictionary = dict_descriptor->stringDict.get();
55  }
56  import_buffers.emplace_back(
57  std::make_unique<import_export::TypedImportBuffer>(column, string_dictionary));
58  }
59  }
60 }
std::vector< std::unique_ptr< import_export::TypedImportBuffer > > import_buffers
const import_export::CopyParams copy_params
std::unique_ptr< ForeignTableSchema > foreign_table_schema
std::list< const ColumnDescriptor * > getColumns() const
std::shared_ptr< Catalog_Namespace::Catalog > getCatalog() const
#define IS_STRING(T)
Definition: sqltypes.h:322
const RenderGroupAnalyzerMap * render_group_analyzer_map

+ Here is the call graph for this function:

Member Function Documentation

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

Definition at line 39 of file TextFileBufferParser.h.

References CHECK, Catalog_Namespace::SysCatalog::getCatalog(), and Catalog_Namespace::SysCatalog::instance().

Referenced by foreign_storage::TextFileBufferParser::fillRejectedRowWithInvalidData(), foreign_storage::CsvFileBufferParser::parseBuffer(), foreign_storage::RegexFileBufferParser::parseBuffer(), and ParseBufferRequest().

39  {
41  CHECK(catalog);
42  return catalog;
43  }
static SysCatalog & instance()
Definition: SysCatalog.h:341
std::shared_ptr< Catalog > getCatalog(const std::string &dbName)
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 45 of file TextFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::CsvFileBufferParser::parseBuffer(), foreign_storage::RegexFileBufferParser::parseBuffer(), ParseBufferRequest(), and foreign_storage::populate_chunks().

45  {
46  return foreign_table_schema->getLogicalAndPhysicalColumns();
47  }
std::unique_ptr< ForeignTableSchema > foreign_table_schema

+ Here is the caller graph for this function:

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

Definition at line 61 of file TextFileBufferParser.h.

References full_path.

Referenced by foreign_storage::CsvFileBufferParser::parseBuffer(), foreign_storage::RegexFileBufferParser::parseBuffer(), foreign_storage::populate_chunks_using_data_blocks(), and foreign_storage::process_data_blocks().

+ Here is the caller graph for this function:

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

Definition at line 57 of file TextFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::populate_chunks().

57  {
58  return foreign_table_schema->getForeignTable()->maxFragRows;
59  }
std::unique_ptr< ForeignTableSchema > foreign_table_schema

+ Here is the caller graph for this function:

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

Definition at line 49 of file TextFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::populate_chunks_using_data_blocks(), and foreign_storage::process_data_blocks().

49  {
50  return foreign_table_schema->getForeignTable()->tableId;
51  }
std::unique_ptr< ForeignTableSchema > foreign_table_schema

+ Here is the caller graph for this function:

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

Definition at line 53 of file TextFileBufferParser.h.

References foreign_table_schema.

Referenced by foreign_storage::parse_file_regions().

53  {
54  return foreign_table_schema->getForeignTable()->tableName;
55  }
std::unique_ptr< ForeignTableSchema > foreign_table_schema

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 66 of file TextFileBufferParser.h.

size_t foreign_storage::ParseBufferRequest::buffer_row_count

Definition at line 74 of file TextFileBufferParser.h.

Referenced by foreign_storage::populate_chunks().

size_t foreign_storage::ParseBufferRequest::buffer_size
std::unique_ptr<ForeignTableSchema> foreign_storage::ParseBufferRequest::foreign_table_schema
std::string foreign_storage::ParseBufferRequest::full_path

Definition at line 80 of file TextFileBufferParser.h.

Referenced by getFilePath().

size_t foreign_storage::ParseBufferRequest::processed_row_count

Definition at line 87 of file TextFileBufferParser.h.

Referenced by foreign_storage::populate_chunks().

const RenderGroupAnalyzerMap* foreign_storage::ParseBufferRequest::render_group_analyzer_map
const bool foreign_storage::ParseBufferRequest::track_rejected_rows

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