[Storage] Add UC Delta API credential property mapping#6677
[Storage] Add UC Delta API credential property mapping#6677TimothyW553 wants to merge 2 commits into
Conversation
f4893d8 to
8bc003e
Compare
e433d7e to
eab7835
Compare
6dd01e2 to
04445d1
Compare
c5085fe to
05f90da
Compare
| return self(); | ||
| } | ||
|
|
||
| public T table(String catalog, String schema, String table, String location) { |
There was a problem hiding this comment.
This mostly follows UC Spark CredPropsUtil; the main extra Delta shape is storing catalog/schema/table/location so renewal can call UC Delta table credential APIs.
|
|
||
| package io.delta.storage.unitycatalog.hadoop; | ||
|
|
||
| public class UCDeltaRestCatalogApiCredentialConf { |
There was a problem hiding this comment.
This is a smaller Delta storage copy of UC UCHadoopConf; it keeps only the credential Hadoop keys needed by these helpers.
| if (conf.get(UCDeltaRestCatalogApiCredentialConf.AZURE_INIT_SAS_TOKEN) != null | ||
| && conf.get(UCDeltaRestCatalogApiCredentialConf.AZURE_INIT_SAS_TOKEN_EXPIRED_TIME) != null) { | ||
| String sasToken = conf.get(UCDeltaRestCatalogApiCredentialConf.AZURE_INIT_SAS_TOKEN); | ||
| Objects.requireNonNull( |
There was a problem hiding this comment.
This is a straight UC Spark port; the main difference is replacing Guava Preconditions with JDK checks.
| return new GenericCredential(tempCred); | ||
| } | ||
|
|
||
| public static GenericCredential fromStorageCredential(StorageCredential storageCredential) { |
There was a problem hiding this comment.
This adapter is Delta-specific because UC Delta APIs return StorageCredential, while UC Spark renewal returns TemporaryCredentials directly.
| return credential; | ||
| } | ||
|
|
||
| protected UCClient ucClient() { |
There was a problem hiding this comment.
This is the main non-port file: renewal uses Delta UCClient / UCTokenBasedRestClient instead of UC Spark legacy TemporaryCredentialsApi.
| final long maxSize = | ||
| Long.getLong(CRED_SCOPED_FS_CACHE_MAX_SIZE, CRED_SCOPED_FS_CACHE_MAX_SIZE_DEFAULT); | ||
| CACHE = | ||
| Collections.synchronizedMap( |
There was a problem hiding this comment.
Same credential-scoped FS logic as UC Spark, but Guava CacheBuilder is replaced with a JDK synchronized LRU map for storage.
05f90da to
7672549
Compare
7672549 to
3c158ad
Compare
| @@ -0,0 +1,73 @@ | |||
| /* | |||
There was a problem hiding this comment.
Hi @TimothyW553 , I think one key request is: how could we migrate the tests also from the unitycatalog spark connector to the delta repo also ?
because we don't want any functional regression after we do the migration.
3c158ad to
5dacf5d
Compare
5dacf5d to
e0b7139
Compare
|
Closing this because PR3 now uses unitycatalog-hadoop directly, so this copied credential mapping PR is no longer needed. |
🥞 Stacked PR
Use this link to review incremental changes.
Which Delta project/connector is this regarding?
Spark / Unity Catalog
Description
This PR adds Delta-owned credential property mapping for credentials returned by the UC Delta Rest Catalog API.
UC Delta Rest Catalog API responses contain UC credential models, while Delta file access still needs Hadoop filesystem properties. This PR copies the required UC Spark credential mapping into Delta Spark so later PRs can use the same conversion for both named table credentials and temporary path credentials.
This PR adds:
CredPropsUtilfor table-scoped and path-scoped credentials.AccessTokenconstructor compatibility fix forutil-hadoop 3.0.2.This PR only adds the credential utility layer. Child PRs wire it into UC Delta Rest Catalog API
loadTable, path credentials, and create table flows.How was this patch tested?
Covered by
UCDeltaRestCatalogApiCredentialPropsUtilSuitefor:Also compiled
iceberg/Compile/compilefor the GCS compatibility fix.Does this PR introduce any user-facing changes?
No. This only adds internal Delta Spark credential mapping utilities for the UC Delta Rest Catalog API stack.