Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::ReplacementScan Struct Reference
Collaboration diagram for duckdb::ReplacementScan:

Public Member Functions

 ReplacementScan (replacement_scan_t function, unique_ptr< ReplacementScanData > data_p=nullptr)
 

Static Public Member Functions

static bool CanReplace (const string &table_name, const vector< string > &extensions)
 
static string GetFullPath (const string &catalog, const string &schema, const string &table)
 
static string GetFullPath (ReplacementScanInput &input)
 

Public Attributes

replacement_scan_t function
 
unique_ptr< ReplacementScanDatadata
 

Detailed Description

Replacement table scans are automatically attempted when a table name cannot be found in the schema This allows you to do e.g. SELECT * FROM 'filename.csv', and automatically convert this into a CSV scan

Constructor & Destructor Documentation

◆ ReplacementScan()

duckdb::ReplacementScan::ReplacementScan ( replacement_scan_t  function,
unique_ptr< ReplacementScanData data_p = nullptr 
)
inlineexplicit
38711 : function(function), data(std::move(data_p)) {
38712 }

Member Function Documentation

◆ CanReplace()

static bool duckdb::ReplacementScan::CanReplace ( const string &  table_name,
const vector< string > &  extensions 
)
inlinestatic
38714 {
38715 auto lower_name = StringUtil::Lower(table_name);
38716
38717 if (StringUtil::EndsWith(lower_name, CompressionExtensionFromType(FileCompressionType::GZIP))) {
38718 lower_name = lower_name.substr(0, lower_name.size() - 3);
38719 } else if (StringUtil::EndsWith(lower_name, CompressionExtensionFromType(FileCompressionType::ZSTD))) {
38720 lower_name = lower_name.substr(0, lower_name.size() - 4);
38721 }
38722
38723 for (auto &extension : extensions) {
38724 if (StringUtil::EndsWith(lower_name, "." + extension) ||
38725 StringUtil::Contains(lower_name, "." + extension + "?")) {
38726 return true;
38727 }
38728 }
38729
38730 return false;
38731 }
static DUCKDB_API string Lower(const string &str)
Convert a string to lowercase.
static DUCKDB_API bool Contains(const string &haystack, const string &needle)
Returns true if the needle string exists in the haystack.
static DUCKDB_API bool EndsWith(const string &str, const string &suffix)
Returns true if the target string ends with the given suffix.

◆ GetFullPath() [1/2]

static string duckdb::ReplacementScan::GetFullPath ( const string &  catalog,
const string &  schema,
const string &  table 
)
inlinestatic
38733 {
38734 string table_name = catalog;
38735 if (!schema.empty()) {
38736 table_name += (!table_name.empty() ? "." : "") + schema;
38737 }
38738 table_name += (!table_name.empty() ? "." : "") + table;
38739 return table_name;
38740 }

◆ GetFullPath() [2/2]

static string duckdb::ReplacementScan::GetFullPath ( ReplacementScanInput input)
inlinestatic
38742 {
38743 return GetFullPath(input.catalog_name, input.schema_name, input.table_name);
38744 }

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