Return-Path: Delivered-To: apmail-hadoop-common-issues-archive@minotaur.apache.org Received: (qmail 69734 invoked from network); 12 Apr 2011 14:55:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Apr 2011 14:55:46 -0000 Received: (qmail 68585 invoked by uid 500); 12 Apr 2011 14:55:46 -0000 Delivered-To: apmail-hadoop-common-issues-archive@hadoop.apache.org Received: (qmail 68552 invoked by uid 500); 12 Apr 2011 14:55:46 -0000 Mailing-List: contact common-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-issues@hadoop.apache.org Delivered-To: mailing list common-issues@hadoop.apache.org Received: (qmail 68544 invoked by uid 99); 12 Apr 2011 14:55:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 14:55:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2011 14:55:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 025D59EC95 for ; Tue, 12 Apr 2011 14:55:06 +0000 (UTC) Date: Tue, 12 Apr 2011 14:55:06 +0000 (UTC) From: "Karl Kuntz (JIRA)" To: common-issues@hadoop.apache.org Message-ID: <1735593522.52359.1302620106006.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (HADOOP-7222) Inconsistent behavior when passing a path with special characters as literals to some FsShell commands MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Inconsistent behavior when passing a path with special characters as literals to some FsShell commands ------------------------------------------------------------------------------------------------------ Key: HADOOP-7222 URL: https://issues.apache.org/jira/browse/HADOOP-7222 Project: Hadoop Common Issue Type: Bug Components: fs, scripts Affects Versions: 0.20.2 Environment: Unix, Java 1.6, hadoop 0.20.2 Reporter: Karl Kuntz hadoop dfs -put test^ing /tmp <- works hadoop dfs -ls /tmp <- works, shows the file in the dir hadoop dfs -ls /tmp/test^ing <- fails, returns "ls: Cannot access /tmp/test^ing: No such file or directory." hadoop dfs -get /tmp/test^ing test^ing <- fails, returns "get: null" It is possible to put a file with some special characters, such as ^ using the hadoop shell. But once put one cannot ls, cat, or get the file due to the way some commands deal with file globbing. Harsh J suggested on the mailing list that perhaps a flag that would turn off globbing could be implemented. Perhaps something like single quoting the file path on the command line to disable globbing would work as well. As an example in the source for 0.20.2 the ^ character in particular wasn't escaped in in the output pattern in FileSystem.java @line 1050 in setRegex(String filePattern).: ... } else if (pCh == '[' && setOpen == 0) { setOpen++; hasPattern = true; } else if (pCh == '^' && setOpen > 0) { } else if (pCh == '-' && setOpen > 0) { // Character set range setRange = true; ... After looking in trunk, it seems to have been dealt with in later versions (refactored into GlobPattern.java) ... case '^': // ^ inside [...] can be unescaped if (setOpen == 0) { regex.append(BACKSLASH); } break; case '!': // ... but even after pushing that back in 0.20.2 and testing it appears to resolve the issue for commands like ls, but not for get. So perhaps there is more to be done for other commands? -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira