Skip to content

Commit

Permalink
Merge pull request #92 from gdubya/fix-fabric
Browse files Browse the repository at this point in the history
fix: correct endpoint when using onelake
  • Loading branch information
samansmink authored Sep 13, 2024
2 parents 24d9b78 + 0bc799a commit 6feb423
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 6feb423

Please sign in to comment.