Skip to content

Commit 58f15dc

Browse files
committed
avoid fallback for s3 urls
1 parent cb96000 commit 58f15dc

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

extension/httpfs/httpfs.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ unique_ptr<HTTPResponse> HTTPFileSystem::GetRangeRequest(FileHandle &handle, str
254254
return true;
255255
});
256256

257-
get_request.try_request = true;
257+
get_request.try_request = hfh.auto_fallback_to_full_file_download;
258258

259259
auto response = http_util.Request(get_request, http_client);
260260

@@ -360,8 +360,8 @@ bool HTTPFileSystem::TryRangeRequest(FileHandle &handle, string url, HTTPHeaders
360360
return false;
361361
}
362362

363-
error.Throw();
364363
}
364+
error.Throw();
365365
}
366366
throw HTTPException(*res, "Request returned HTTP %d for HTTP %s to '%s'",
367367
static_cast<int>(res->status), EnumUtil::ToString(RequestType::GET_REQUEST), res->url);

extension/httpfs/include/s3fs.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ class S3FileHandle : public HTTPFileHandle {
116116
: HTTPFileHandle(fs, file, flags, std::move(http_params_p)), auth_params(auth_params_p),
117117
config_params(config_params_p), uploads_in_progress(0), parts_uploaded(0), upload_finalized(false),
118118
uploader_has_error(false), upload_exception(nullptr) {
119+
auto_fallback_to_full_file_download = false;
119120
if (flags.OpenForReading() && flags.OpenForWriting()) {
120121
throw NotImplementedException("Cannot open an HTTP file for both reading and writing");
121122
} else if (flags.OpenForAppending()) {

test/sql/secret/secret_refresh.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ CREATE SECRET s1 (
8484
statement error
8585
FROM "s3://test-bucket/test-file.parquet"
8686
----
87-
403
87+
HTTP Error: HTTP GET error on 'http://test-bucket.duckdb-minio.com:9000/test-file.parquet' (HTTP 403)
8888

8989
query I
9090
SELECT message[0:46] FROM duckdb_logs WHERE message like '%Successfully refreshed secret%'
@@ -125,7 +125,7 @@ set s3_access_key_id='bogus'
125125
statement error
126126
FROM "s3://test-bucket/test-file.parquet"
127127
----
128-
403
128+
HTTP Error: HTTP GET error on 'http://test-bucket.duckdb-minio.com:9000/test-file.parquet' (HTTP 403)
129129

130130
# -> log empty
131131
query II

0 commit comments

Comments
 (0)