Skip to content
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
3 changes: 2 additions & 1 deletion lib/src/webdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "duckdb/common/types/data_chunk.hpp"
#include "duckdb/common/types/vector.hpp"
#include "duckdb/common/types/vector_buffer.hpp"
#include "duckdb/common/virtual_file_system.hpp"
#include "duckdb/main/query_result.hpp"
#include "duckdb/parser/expression/constant_expression.hpp"
#include "duckdb/parser/parser.hpp"
Expand Down Expand Up @@ -866,7 +867,7 @@ arrow::Status WebDB::Open(std::string_view args_json) {
auto buffered_fs_ptr = buffered_fs.get();

duckdb::DBConfig db_config;
db_config.file_system = std::move(buffered_fs);
db_config.file_system = std::move(make_uniq<VirtualFileSystem>(std::move(buffered_fs)));
db_config.options.allow_unsigned_extensions = config_->allow_unsigned_extensions;
db_config.options.maximum_threads = config_->maximum_threads;
db_config.options.use_temporary_directory = false;
Expand Down
6 changes: 6 additions & 0 deletions packages/duckdb-wasm/test/httpfs_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,12 @@ export function testHTTPFSAsync(
expect(BigInt(results.getChildAt(2)?.get(2))).toEqual(BigInt(9n));
});

it('can fetch over https csv.gz', async () => {
await conn!.query(
`select * from "https://raw.githubusercontent.com/duckdb/duckdb/v1.2.2/data/csv/test_apple_financial.csv.gz";`,
);
});

it('can read and write csv file from S3 with correct auth credentials', async () => {
let data = await resolveData('/uni/studenten.parquet');
await setAwsConfig(conn!);
Expand Down
26 changes: 26 additions & 0 deletions patches/duckdb/virtualized_file_system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/src/common/virtual_file_system.cpp b/src/common/virtual_file_system.cpp
index 74892a4e05..c3d1c4f333 100644
--- a/src/common/virtual_file_system.cpp
+++ b/src/common/virtual_file_system.cpp
@@ -5,7 +5,7 @@

namespace duckdb {

-VirtualFileSystem::VirtualFileSystem() : default_fs(FileSystem::CreateLocal()) {
+VirtualFileSystem::VirtualFileSystem(unique_ptr<FileSystem> inner) : default_fs(std::move(inner)) {
VirtualFileSystem::RegisterSubSystem(FileCompressionType::GZIP, make_uniq<GZipFileSystem>());
}

diff --git a/src/include/duckdb/common/virtual_file_system.hpp b/src/include/duckdb/common/virtual_file_system.hpp
index 110ad04877..30a7eb29d3 100644
--- a/src/include/duckdb/common/virtual_file_system.hpp
+++ b/src/include/duckdb/common/virtual_file_system.hpp
@@ -17,7 +17,7 @@ namespace duckdb {
// bunch of wrappers to allow registering protocol handlers
class VirtualFileSystem : public FileSystem {
public:
- VirtualFileSystem();
+ VirtualFileSystem(unique_ptr<FileSystem> inner_file_system = nullptr);

unique_ptr<FileHandle> OpenFile(const string &path, FileOpenFlags flags,
optional_ptr<FileOpener> opener = nullptr) override;