Skip to content

Commit

Permalink
Fix remote filesystem glob (#4933)
Browse files Browse the repository at this point in the history
  • Loading branch information
royi-luo authored Feb 19, 2025
1 parent 31651c5 commit bf8c8b8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
20 changes: 20 additions & 0 deletions extension/httpfs/test/test_files/gcs_glob.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-DATASET CSV empty

--

-CASE GCSGlob
-STATEMENT load extension "${KUZU_ROOT_DIRECTORY}/extension/httpfs/build/libhttpfs.kuzu_extension"
---- ok
-STATEMENT create node table person (ID INt64, fName StRING, gender INT64, isStudent BoOLEAN, isWorker BOOLEAN, age INT64, eyeSight DOUBLE, birthdate DATE, registerTime TIMESTAMP, lastJobDuration interval, workedHours INT64[], usedNames STRING[], courseScoresPerTerm INT64[][], grades INT64[4], height float, u UUID, PRIMARY KEY (ID));
---- ok
-STATEMENT copy person from "gs://tinysnb/vPerson*.csv"(header=true);
---- ok
-STATEMENT match (p:person) return p.id;
---- 7
0
2
3
5
7
9
10
7 changes: 6 additions & 1 deletion src/binder/bind/bind_file_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "common/file_system/virtual_file_system.h"
#include "common/string_format.h"
#include "common/string_utils.h"
#include "extension/extension_manager.h"
#include "function/table/bind_input.h"
#include "main/database_manager.h"
#include "parser/scan_source.h"
Expand Down Expand Up @@ -49,7 +50,11 @@ std::vector<std::string> Binder::bindFilePaths(const std::vector<std::string>& f
// When we read delta/iceberg tables from s3/httpfs, we don't have the httpfs extension
// loaded meaning that we cannot handle remote paths. So we pass the file path to duckdb
// for validation when we bindFileScanSource.
if (!LocalFileSystem::isLocalPath(filePath)) {
const auto& loadedExtensions = clientContext->getExtensionManager()->getLoadedExtensions();
const bool httpfsExtensionLoaded =
std::any_of(loadedExtensions.begin(), loadedExtensions.end(),
[](const auto& extension) { return extension.getExtensionName() == "HTTPFS"; });
if (!httpfsExtensionLoaded && !LocalFileSystem::isLocalPath(filePath)) {
boundFilePaths.push_back(filePath);
continue;
}
Expand Down

0 comments on commit bf8c8b8

Please sign in to comment.