Skip to content

Commit

Permalink
fix: correct endpoint when using onelake
Browse files Browse the repository at this point in the history
  • Loading branch information
gdubya committed Sep 12, 2024
1 parent 24d9b78 commit 0bc799a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/functions/delta_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ static ffi::EngineBuilder* CreateBuilder(ClientContext &context, const string &p
secret_reader.TryGetSecretKey("tenant_id", tenant_id);
secret_reader.TryGetSecretKey("chain", chain);

if (!account_name.empty() && account_name == "onelake") {
ffi::set_builder_option(builder, KernelUtils::ToDeltaString("use_fabric_endpoint"), KernelUtils::ToDeltaString("true"));
}

auto provider = kv_secret.GetProvider();
if (provider == "access_token") {
// Authentication option 0: https://docs.rs/object_store/latest/object_store/azure/enum.AzureConfigKey.html#variant.Token
Expand Down Expand Up @@ -344,8 +348,6 @@ static ffi::EngineBuilder* CreateBuilder(ClientContext &context, const string &p
}
if (!endpoint.empty()) {
ffi::set_builder_option(builder, KernelUtils::ToDeltaString("azure_endpoint"), KernelUtils::ToDeltaString(endpoint));
} else {
ffi::set_builder_option(builder, KernelUtils::ToDeltaString("azure_endpoint"), KernelUtils::ToDeltaString("https://" + account_name + ".blob.core.windows.net/"));
}
ffi::set_builder_option(builder, KernelUtils::ToDeltaString("container_name"), KernelUtils::ToDeltaString(bucket));
}
Expand Down

0 comments on commit 0bc799a

Please sign in to comment.