Skip to content

Commit

Permalink
Update to DuckDB 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mkaruza committed Jan 20, 2025
1 parent d9ca552 commit 41b8c71
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions third_party/cached_httpfs/hffs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "duckdb/common/types/hash.hpp"
#include "duckdb/main/database.hpp"
#include "duckdb/main/secret/secret_manager.hpp"
#include "duckdb/function/scalar/string_functions.hpp"
#include "duckdb/function/scalar/string_common.hpp"

#include <chrono>
#include <string>
Expand Down Expand Up @@ -117,7 +117,7 @@ static bool Match(vector<string>::const_iterator key, vector<string>::const_iter
}
return false;
}
if (!LikeFun::Glob(key->data(), key->length(), pattern->data(), pattern->length())) {
if (!Glob(key->data(), key->length(), pattern->data(), pattern->length())) {
return false;
}
key++;
Expand Down
6 changes: 4 additions & 2 deletions third_party/cached_httpfs/httpfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ HTTPFileSystem::RunRequestWithRetry(const std::function<duckdb_httplib_openssl::
}
} catch (IOException &e) {
caught_e = std::current_exception();
} catch (HTTPException &e) {
caught_e = std::current_exception();
}

// Note: all duckdb_httplib_openssl::Error types will be retried.
Expand Down Expand Up @@ -443,8 +445,8 @@ unique_ptr<ResponseWrapper> HTTPFileSystem::GetRangeRequest(FileHandle &handle,
}

HTTPFileHandle::HTTPFileHandle(FileSystem &fs, const string &path, FileOpenFlags flags, const HTTPParams &http_params)
: FileHandle(fs, path), http_params(http_params), flags(flags), length(0), buffer_available(0), buffer_idx(0),
file_offset(0), buffer_start(0), buffer_end(0) {
: FileHandle(fs, path, flags), http_params(http_params), flags(flags), length(0), buffer_available(0),
buffer_idx(0), file_offset(0), buffer_start(0), buffer_end(0) {
}

unique_ptr<HTTPFileHandle> HTTPFileSystem::CreateHandle(const string &path, FileOpenFlags flags,
Expand Down
11 changes: 7 additions & 4 deletions third_party/cached_httpfs/s3fs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#endif

#include "duckdb/common/string_util.hpp"
#include "duckdb/function/scalar/string_functions.hpp"
#include "duckdb/function/scalar/string_common.hpp"
#include "duckdb/main/secret/secret_manager.hpp"
#include "duckdb/storage/buffer_manager.hpp"

Expand Down Expand Up @@ -324,7 +324,11 @@ void S3FileSystem::UploadBuffer(S3FileHandle &file_handle, shared_ptr<S3WriteBuf
throw IOException("Unexpected response when uploading part to S3");
}

} catch (IOException &ex) {
} catch (std::exception &ex) {
ErrorData error(ex);
if (error.Type() != ExceptionType::IO && error.Type() != ExceptionType::HTTP) {
throw;
}
// Ensure only one thread sets the exception
bool f = false;
auto exchanged = file_handle.uploader_has_error.compare_exchange_strong(f, true);
Expand All @@ -333,7 +337,6 @@ void S3FileSystem::UploadBuffer(S3FileHandle &file_handle, shared_ptr<S3WriteBuf
}

NotifyUploadsInProgress(file_handle);

return;
}

Expand Down Expand Up @@ -869,7 +872,7 @@ static bool Match(vector<string>::const_iterator key, vector<string>::const_iter
}
return false;
}
if (!LikeFun::Glob(key->data(), key->length(), pattern->data(), pattern->length())) {
if (!Glob(key->data(), key->length(), pattern->data(), pattern->length())) {
return false;
}
key++;
Expand Down

0 comments on commit 41b8c71

Please sign in to comment.