OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
foreign_storage::RegexParserDataWrapper Class Reference

#include <RegexParserDataWrapper.h>

+ Inheritance diagram for foreign_storage::RegexParserDataWrapper:
+ Collaboration diagram for foreign_storage::RegexParserDataWrapper:

Public Member Functions

 RegexParserDataWrapper ()
 
 RegexParserDataWrapper (const int db_id, const ForeignTable *foreign_table)
 
void validateTableOptions (const ForeignTable *foreign_table) const override
 
const std::set
< std::string_view > & 
getSupportedTableOptions () const override
 
- Public Member Functions inherited from foreign_storage::AbstractTextFileDataWrapper
 AbstractTextFileDataWrapper ()
 
 AbstractTextFileDataWrapper (const int db_id, const ForeignTable *foreign_table)
 
void populateChunkMetadata (ChunkMetadataVector &chunk_metadata_vector) override
 
void populateChunkBuffers (const ChunkToBufferMap &required_buffers, const ChunkToBufferMap &optional_buffers) override
 
std::string getSerializedDataWrapper () const override
 
void restoreDataWrapperInternals (const std::string &file_path, const ChunkMetadataVector &chunk_metadata) override
 
bool isRestored () const override
 
ParallelismLevel getCachedParallelismLevel () const override
 
ParallelismLevel getNonCachedParallelismLevel () const override
 
- Public Member Functions inherited from foreign_storage::AbstractFileStorageDataWrapper
 AbstractFileStorageDataWrapper ()
 
void validateServerOptions (const ForeignServer *foreign_server) const override
 
void validateUserMappingOptions (const UserMapping *user_mapping, const ForeignServer *foreign_server) const override
 
const std::set
< std::string_view > & 
getSupportedUserMappingOptions () const override
 
- Public Member Functions inherited from foreign_storage::ForeignDataWrapper
 ForeignDataWrapper ()=default
 
virtual ~ForeignDataWrapper ()=default
 
virtual void validateSchema (const std::list< ColumnDescriptor > &columns) const
 

Protected Member Functions

const TextFileBufferParsergetFileBufferParser () const override
 

Private Member Functions

std::set< std::string_view > getAllRegexTableOptions () const
 

Private Attributes

const RegexFileBufferParser regex_file_buffer_parser_
 

Static Private Attributes

static const std::set
< std::string_view > 
regex_table_options_
 

Additional Inherited Members

- Public Types inherited from foreign_storage::ForeignDataWrapper
enum  ParallelismLevel { NONE, INTRA_FRAGMENT, INTER_FRAGMENT }
 
- Static Public Attributes inherited from foreign_storage::AbstractFileStorageDataWrapper
static const std::string STORAGE_TYPE_KEY = "STORAGE_TYPE"
 
static const std::string BASE_PATH_KEY = "BASE_PATH"
 
static const std::string FILE_PATH_KEY = "FILE_PATH"
 
static const std::string REGEX_PATH_FILTER_KEY = "REGEX_PATH_FILTER"
 
static const std::string LOCAL_FILE_STORAGE_TYPE = "LOCAL_FILE"
 
static const std::string S3_STORAGE_TYPE = "AWS_S3"
 
static const std::string FILE_SORT_ORDER_BY_KEY = shared::FILE_SORT_ORDER_BY_KEY
 
static const std::string FILE_SORT_REGEX_KEY = shared::FILE_SORT_REGEX_KEY
 
static const std::array
< std::string, 1 > 
supported_storage_types
 
- Static Protected Member Functions inherited from foreign_storage::AbstractFileStorageDataWrapper
static std::string getFullFilePath (const ForeignTable *foreign_table)
 Returns the path to the source file/dir of the table. Depending on options this may result from a concatenation of server and table path options. More...
 

Detailed Description

Definition at line 23 of file RegexParserDataWrapper.h.

Constructor & Destructor Documentation

foreign_storage::RegexParserDataWrapper::RegexParserDataWrapper ( )
foreign_storage::RegexParserDataWrapper::RegexParserDataWrapper ( const int  db_id,
const ForeignTable foreign_table 
)

Definition at line 28 of file RegexParserDataWrapper.cpp.

Member Function Documentation

std::set< std::string_view > foreign_storage::RegexParserDataWrapper::getAllRegexTableOptions ( ) const
private

Definition at line 74 of file RegexParserDataWrapper.cpp.

References foreign_storage::AbstractFileStorageDataWrapper::getSupportedTableOptions(), and regex_table_options_.

Referenced by getSupportedTableOptions().

74  {
75  std::set<std::string_view> supported_table_options(
78  supported_table_options.insert(regex_table_options_.begin(),
79  regex_table_options_.end());
80  return supported_table_options;
81 }
static const std::set< std::string_view > regex_table_options_
const std::set< std::string_view > & getSupportedTableOptions() const override

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const TextFileBufferParser & foreign_storage::RegexParserDataWrapper::getFileBufferParser ( ) const
overrideprotectedvirtual

Implements foreign_storage::AbstractTextFileDataWrapper.

Definition at line 83 of file RegexParserDataWrapper.cpp.

References regex_file_buffer_parser_.

83  {
85 }
const RegexFileBufferParser regex_file_buffer_parser_
const std::set< std::string_view > & foreign_storage::RegexParserDataWrapper::getSupportedTableOptions ( ) const
overridevirtual

Gets the set of supported table options for the data wrapper.

Reimplemented from foreign_storage::AbstractFileStorageDataWrapper.

Definition at line 68 of file RegexParserDataWrapper.cpp.

References getAllRegexTableOptions().

69  {
70  static const auto supported_table_options = getAllRegexTableOptions();
71  return supported_table_options;
72 }
std::set< std::string_view > getAllRegexTableOptions() const

+ Here is the call graph for this function:

void foreign_storage::RegexParserDataWrapper::validateTableOptions ( const ForeignTable foreign_table) const
overridevirtual

Checks that the options for the given foreign table object are valid.

Parameters
foreign_table- foreign table object containing options to be validated

Reimplemented from foreign_storage::AbstractFileStorageDataWrapper.

Definition at line 44 of file RegexParserDataWrapper.cpp.

References foreign_storage::RegexFileBufferParser::LINE_REGEX_KEY, foreign_storage::RegexFileBufferParser::LINE_START_REGEX_KEY, foreign_storage::OptionsContainer::options, foreign_storage::anonymous_namespace{RegexParserDataWrapper.cpp}::validate_regex(), and foreign_storage::AbstractFileStorageDataWrapper::validateTableOptions().

45  {
47  auto line_regex_it = foreign_table->options.find(RegexFileBufferParser::LINE_REGEX_KEY);
48  if (line_regex_it == foreign_table->options.end() || line_regex_it->second.empty()) {
49  throw ForeignStorageException{
50  "Foreign table options must contain a non-empty value for \"" +
52  }
54 
55  auto line_start_regex_it =
56  foreign_table->options.find(RegexFileBufferParser::LINE_START_REGEX_KEY);
57  if (line_start_regex_it != foreign_table->options.end()) {
58  if (line_start_regex_it->second.empty()) {
59  throw ForeignStorageException{"Foreign table option \"" +
61  "\", when set, must contain a non-empty value."};
62  }
63  validate_regex(line_start_regex_it->second,
65  }
66 }
void validateTableOptions(const ForeignTable *foreign_table) const override
void validate_regex(const std::string &regex, const std::string &option_name)

+ Here is the call graph for this function:

Member Data Documentation

const RegexFileBufferParser foreign_storage::RegexParserDataWrapper::regex_file_buffer_parser_
private

Definition at line 39 of file RegexParserDataWrapper.h.

Referenced by getFileBufferParser().

const std::set< std::string_view > foreign_storage::RegexParserDataWrapper::regex_table_options_
staticprivate

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