[
https://issues.apache.org/jira/browse/HADOOP-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426906#comment-13426906
]
Brandon Li commented on HADOOP-8583:
------------------------------------
Basically, batch script expansion caused the problem.
Here is how the expansion happens on Windows:
1. cmd.exe passed "/tmp/*" to %HADOOP_HOME%\bin\hadoop script
2. hadoop script also passes "/tmp/*" to %HADOOP_HOME%\bin\hdfs.cmd
3. the expansion is done by the shell function make_command_arguments in
hdfs.cmd. If it has problem expanding the name, it just simply drop it.
4. when FsShell gets the request, either it gets a list of expended name or no
name. FsShell doesn't know the expended names are from outside HDFS. When there
is no name with some command, FsShell complains and prints the usage
information.
{noformat}
:make_command_arguments
if "%2" == "" goto :eof
set _count=0
if defined service_entry (set _shift=2) else (set _shift=1)
if defined config_override (set /a _shift=!_shift! + 2)
for %%i in (%*) do ( <== expansion happens here!!!
set /a _count=!_count!+1
if !_count! GTR %_shift% (
if not defined _hdfsarguments (
set _hdfsarguments=%%i
) else (
set _hdfsarguments=!_hdfsarguments! %%i
)
)
)
set hdfs-command-arguments=%_hdfsarguments%
goto :eof
{noformat}
Using single quotation marks around the pathname may result in getting the
pathname dropped by the above function. Therefore it is not a good workaround.
Looks like the above function needs to be fixed.
> Globbing is not correctly handled in a few cases on Windows
> -----------------------------------------------------------
>
> Key: HADOOP-8583
> URL: https://issues.apache.org/jira/browse/HADOOP-8583
> Project: Hadoop Common
> Issue Type: Bug
> Environment: Windows
> Reporter: Ramya Sunil
>
> Glob handling fails in a few cases on a Windows environment.
> For example:
> {noformat}
> c:\> hadoop dfs -ls /
> Found 2 items
> drwxrwxrwx - Administrator supergroup 0 2012-07-06 15:00 /tmp
> drwxr-xr-x - Administrator supergroup 0 2012-07-06 18:52 /user
> c:\> hadoop dfs -ls /tmpInvalid*
> Found 2 items
> drwxr-xr-x - Administrator supergroup 0 2012-07-10 18:50
> /user/Administrator/sortInputDir
> drwxr-xr-x - Administrator supergroup 0 2012-07-10 18:50
> /user/Administrator/sortOutputDir
> c:\> hadoop dfs -rmr /tmp/*
> Usage: java FsShell [-rmr [-skipTrash] <src> ]
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira