mridulm commented on code in PR #41821:
URL: https://github.com/apache/spark/pull/41821#discussion_r1253275608


##########
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ClientDistributedCacheManager.scala:
##########
@@ -119,46 +119,61 @@ private[spark] class ClientDistributedCacheManager() 
extends Logging {
    */
   private def isPublic(conf: Configuration, uri: URI, statCache: Map[URI, 
FileStatus]): Boolean = {
     val fs = FileSystem.get(uri, conf)
-    val current = new Path(uri.getPath())
     // the leaf level file should be readable by others
-    if (!checkPermissionOfOther(fs, current, FsAction.READ, statCache)) {
+    if (!checkPermissionOfOther(fs, uri, FsAction.READ, statCache)) {
       return false
     }
-    ancestorsHaveExecutePermissions(fs, current.getParent(), statCache)
+    ancestorsHaveExecutePermissions(fs, getParentURI(uri), statCache)
   }
 
   /**
-   * Returns true if all ancestors of the specified path have the 'execute'
+   * Get the Parent URI of the given URI. Notes the query & fragment of 
original URI will not be
+   * inherited when obtaining parent URI (Path instantiation will not preserve 
query & fragment).

Review Comment:
   ```suggestion
      * Get the Parent URI of the given URI. Notes that the query & fragment of 
original URI will not be
      * inherited when obtaining parent URI.
   ```



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to