snazy commented on code in PR #3347:
URL: https://github.com/apache/polaris/pull/3347#discussion_r2668146947


##########
polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java:
##########
@@ -285,11 +300,22 @@ private String getAdlsUserDelegationSas(
       DataLakeServiceSasSignatureValues signatureValues =
           new DataLakeServiceSasSignatureValues(sasExpiry, pathSasPermission);
 
-      return new DataLakeFileSystemClientBuilder()
-          .endpoint(endpoint)
-          .fileSystemName(fileSystemNameOrContainer)
-          .buildClient()
-          .generateUserDelegationSas(signatureValues, userDelegationKey);
+      if (path != null) {
+        LOGGER.warn("PATH: {}", path);
+        return new DataLakePathClientBuilder()
+            .endpoint(endpoint)
+            .fileSystemName(fileSystemNameOrContainer)
+            .pathName(path) // TODO: drop authority part

Review Comment:
   TODO?



##########
polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java:
##########
@@ -165,6 +167,17 @@ public StorageAccessConfig getSubscopedCreds(
               blobSasPermission,
               Mono.just(accessToken));
     } else if 
(location.getEndpoint().equalsIgnoreCase(AzureLocation.ADLS_ENDPOINT)) {
+      String path = null;
+      if (Boolean.TRUE.equals(config().isHierarchical())) {
+        Preconditions.checkArgument(
+            allowedReadLocations.size() <= 1,
+            "Allowed read locations must not have more that one entry");
+        Preconditions.checkArgument(
+            allowedWriteLocations.size() <= 1,
+            "Allowed write locations must not have more that one entry");
+        path = location.getFilePath();
+      }

Review Comment:
   I think it's probably cleaner to move this whole block into 
`getAdlsUserDelegationSas` and pass `AzureLocation` instead of just 
`AzureLocation.getContainer()`



##########
polaris-core/src/main/java/org/apache/polaris/core/storage/azure/AzureCredentialsStorageIntegration.java:
##########
@@ -285,11 +300,22 @@ private String getAdlsUserDelegationSas(
       DataLakeServiceSasSignatureValues signatureValues =
           new DataLakeServiceSasSignatureValues(sasExpiry, pathSasPermission);
 
-      return new DataLakeFileSystemClientBuilder()
-          .endpoint(endpoint)
-          .fileSystemName(fileSystemNameOrContainer)
-          .buildClient()
-          .generateUserDelegationSas(signatureValues, userDelegationKey);
+      if (path != null) {
+        LOGGER.warn("PATH: {}", path);

Review Comment:
   Why log a warning here?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to