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.
More...
#include <duckdb.hpp>
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.
◆ ReplacementScan()
38711 : function(function), data(std::move(data_p)) {
38712 }
◆ CanReplace()
| bool duckdb::ReplacementScan::CanReplace |
( |
const string & | table_name, |
|
|
const vector< string > & | extensions ) |
|
inlinestatic |
38714 {
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) {
38726 return true;
38727 }
38728 }
38729
38730 return false;
38731 }
static DUCKDB_API bool Contains(const string &haystack, const string &needle)
Returns true if the needle string exists in the haystack.
Definition duckdb.cpp:109323
static DUCKDB_API string Lower(const string &str)
Convert a string to lowercase.
Definition duckdb.cpp:109630
static DUCKDB_API bool EndsWith(const string &str, const string &suffix)
Returns true if the target string ends with the given suffix.
Definition duckdb.cpp:109384
◆ GetFullPath() [1/2]
| 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]
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: