Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid httpfs unsupported settings to autoload httpfs #1672

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -443,4 +443,5 @@ submodules:

# Build infrastructure and packages required for development
build/bootstrap: submodules yarn_install
mkdir -p build
touch build/bootstrap
46 changes: 46 additions & 0 deletions duckdb.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,52 @@ index ea74d55f86..db27a653b3 100644
)
endif()
endfunction()
diff --git a/src/include/duckdb/main/extension_entries.hpp b/src/include/duckdb/main/extension_entries.hpp
index 1c96337d7c..af86306bfe 100644
--- a/src/include/duckdb/main/extension_entries.hpp
+++ b/src/include/duckdb/main/extension_entries.hpp
@@ -209,12 +209,14 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
{"azure_storage_connection_string", "azure"},
{"binary_as_string", "parquet"},
{"calendar", "icu"},
+#ifndef EMSCRIPTEN
{"force_download", "httpfs"},
{"http_retries", "httpfs"},
{"http_retry_backoff", "httpfs"},
{"http_retry_wait_ms", "httpfs"},
{"http_timeout", "httpfs"},
{"http_keep_alive", "httpfs"},
+#endif
{"pg_debug_show_queries", "postgres_scanner"},
{"pg_use_binary_copy", "postgres_scanner"},
{"pg_experimental_filter_pushdown", "postgres_scanner"},
@@ -222,6 +224,7 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
{"pg_connection_limit", "postgres_scanner"},
{"pg_pages_per_task", "postgres_scanner"},
{"pg_array_as_varchar", "postgres_scanner"},
+#ifndef EMSCRIPTEN
{"s3_access_key_id", "httpfs"},
{"s3_endpoint", "httpfs"},
{"s3_region", "httpfs"},
@@ -233,6 +236,7 @@ static constexpr ExtensionEntry EXTENSION_SETTINGS[] = {
{"s3_url_compatibility_mode", "httpfs"},
{"s3_url_style", "httpfs"},
{"s3_use_ssl", "httpfs"},
+#endif
{"sqlite_all_varchar", "sqlite_scanner"},
{"timezone", "icu"},
}; // END_OF_EXTENSION_SETTINGS
@@ -308,8 +312,8 @@ static constexpr ExtensionEntry EXTENSION_SECRET_PROVIDERS[] = {
static constexpr const char *AUTOLOADABLE_EXTENSIONS[] = {
// "azure",
"arrow", "aws", "autocomplete", "excel", "fts", "httpfs",
- // "inet",
- // "icu",
+ "inet",
+ "icu",
"json", "parquet", "postgres_scanner",
// "spatial", TODO: table function isnt always autoloaded so test fails
"sqlsmith", "sqlite_scanner", "tpcds", "tpch"}; // END_OF_AUTOLOADABLE_EXTENSIONS
diff --git a/src/main/extension/extension_install.cpp b/src/main/extension/extension_install.cpp
index 418a298db3..e7943a95e5 100644
--- a/src/main/extension/extension_install.cpp
Expand Down
9 changes: 9 additions & 0 deletions packages/duckdb-wasm/test/httpfs_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,5 +312,14 @@ export function testHTTPFSAsync(
),
).toBeRejectedWithError('Invalid Error: File is not opened in write mode');
});

it('avoid autoloading on not supported httpfs settings', async () => {
await setAwsConfig(conn!);
await expectAsync(
conn!.query(
`set s3_url_style = 'path';`,
),
).toBeRejectedWithError(/Catalog Error: unrecognized configuration parameter "s3_url_style"/);
});
});
}