hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HADOOP-2066) filenames with ':' colon throws java.lang.IllegalArgumentException
Date Wed, 17 Oct 2007 17:47:51 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-2066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Doug Cutting updated HADOOP-2066:
---------------------------------

    Attachment: HADOOP-2066.patch

> The API used does not look like a URI API, hence a URI quoting requirement also seems
wrong.

It is like a URI constructor.  URI cannot be subclassed, and we want to add behavior, so we
wrap our URIs in Paths.  The javadoc for the Path constructor says, and has always said, "Path
strings are URIs".  We long-ago settled on URI syntax for file paths.  So URI escapes seem
appropriate.

I've attached a patch which fixes this on Linux.  Who knows what havoc it will wreak on Windows,
though, where colons in paths are more common, and requiring applications to escape them,
while correct, may prove painful.


> filenames with ':' colon throws java.lang.IllegalArgumentException
> ------------------------------------------------------------------
>
>                 Key: HADOOP-2066
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2066
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>            Reporter: lohit vijayarenu
>         Attachments: HADOOP-2066.patch
>
>
> File names containing colon ":" throws  java.lang.IllegalArgumentException while LINUX
file system supports it.
> [lohit@krygw1000 ~]$ hadoop dfs -put ./testfile-2007-09-24-03:00:00.gz filenametest
> Exception in thread "main" java.lang.IllegalArgumentException: java.net.URISyntaxException:
Relative path in absolute
> URI: testfile-2007-09-24-03:00:00.gz
> 	at org.apache.hadoop.fs.Path.initialize(Path.java:140)
> 	at org.apache.hadoop.fs.Path.<init>(Path.java:126)
> 	at org.apache.hadoop.fs.Path.<init>(Path.java:50)
> 	at org.apache.hadoop.fs.FileUtil.checkDest(FileUtil.java:273)
> 	at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:117)
> 	at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:776)
> 	at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:757)
> 	at org.apache.hadoop.fs.FsShell.copyFromLocal(FsShell.java:116)
> 	at org.apache.hadoop.fs.FsShell.run(FsShell.java:1229)
> 	at org.apache.hadoop.util.ToolBase.doMain(ToolBase.java:187)
> 	at org.apache.hadoop.fs.FsShell.main(FsShell.java:1342)
> Caused by: java.net.URISyntaxException: Relative path in absolute URI: testfile-2007-09-24-03:00:00.gz
> 	at java.net.URI.checkPath(URI.java:1787)
> 	at java.net.URI.<init>(URI.java:735)
> 	at org.apache.hadoop.fs.Path.initialize(Path.java:137)
> 	... 10 more
> [lohit@krygw1000 ~]$ 
> Path(String pathString) when given a filename which contains ':' treats it as URI and
selects anything before ':' as
> scheme, which in this case is clearly not a valid scheme.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message