¿Cómo eliminar un directorio del clúster de Hadoop que tiene coma (,) en su nombre?


He subido un directorio al clúster de hadoop que tiene ", " en su nombre como "MyDir, Name" cuando estoy tratando de eliminar este directorio usando el comando rmr hadoop shell como sigue

hadoop dfs -rmr hdfs://host:port/Navi/MyDir, Name

Estoy recibiendo los siguientes mensajes rmr: cannot remove hdfs: / / host: port/Navi/MyDir,: No such file or directory. rmr: cannot remove Name: No hay tal archivo o directorio.

Sin embargo, he eliminado con éxito otros directorios de la misma ubicación, utilizando el mismo comando i. e.

hadoop dfs -rmr hdfs://host:port/dir_path

Cualquier solución para eliminar este tipo de directorios.

Author: Brian Tompsett - 汤莱恩, 2012-11-23

8 answers

¿has probado :

hadoop dfs -rmr hdfs://host:port/Navi/MyDir\,\ Name?

 51
Author: gega,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-08-10 14:26:17

O si no conoce la url, puede usar

hadoop fs -rm -r -f /user/the/path/to/your/dir
 51
Author: Jeyhun Karimov,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-23 05:43:31
hdfs dfs -rm -r /path/to/directory
 5
Author: noego,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-12-10 09:40:51

Aquí puedes encontrar todos los comandos del shell de hadoop:

Deleting: rmr Uso: hadoop fs -rmr URI [URI …]

Versión recursiva de delete.

Ejemplo:

hadoop fs -rmr /user/hadoop/dir
hadoop fs -rmr hdfs://nn.example.com/user/hadoop/dir

Código de salida:

Devuelve 0 en caso de éxito y -1 en caso de error.

 4
Author: user2531037,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-23 05:46:08

En hadoop1. 0:

hadoop fs -rmr /PATH/ON/HDFS

En hadoop2. 0:

hdfs dfs -rm -R /PATH/ON/HDFS

Use \ para escapar , en path

 3
Author: Ani Menon,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-11-30 06:03:44

Intenta hadoop dfs -rm -r hdfs://host:port/Navi/MyDir\,\ Name ahora

 2
Author: Akarsh,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-23 05:44:07
$ hadoop fs -rmdir {directory_name}
 1
Author: Candice,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-02-23 05:42:25

O puedes: hadoop fs -rm -r PATH

Pista: si introduce: hadoop fs -rmr PATH en su mayoría obtendría: Por favor, use 'rm-r' en su lugar.

 0
Author: Moshih Hsü,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-10-01 21:15:30