You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "George Smith (JIRA)" <ji...@apache.org> on 2018/02/14 15:42:00 UTC

[jira] [Created] (HADOOP-15233) PathData invalid relativize for root and root dir

George Smith created HADOOP-15233:
-------------------------------------

             Summary: PathData invalid relativize for root and root dir
                 Key: HADOOP-15233
                 URL: https://issues.apache.org/jira/browse/HADOOP-15233
             Project: Hadoop Common
          Issue Type: Bug
          Components: common, fs, tools
    Affects Versions: 3.0.0, 2.7.3
            Reporter: George Smith
         Attachments: stacktrace.txt

Let's say current working directory is set to "/"  (FileSystem.setCurrentWorkingDirectory()) and there is "/test" folder on HDFS.

when I call
{code:java}
org.apache.hadoop.fs.shell.PathData.expandAsGlob("test", new Configuration());

{code}
(the relative path to _test_ is an intention)

then I get PathData with a "../test" path. But such path is invalid. The problem is probably inside Path.relativize method, where for "/" and "test" the "../test" is produced.

 

What I really  want is to call "*rm -R test*" command with cwd set to root ("/"), but it won't work because command expands it to invalid path (DFSUtil.isValidName(result) is false).

Using relative paths will work fine for another cwd except the root. This is just the only special case for which it fails.

Stacktrace attached for more details.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-dev-help@hadoop.apache.org