apache/hadoop · error · IOException
Option '-moveToLocal' is not implemented yet.
Error message
Option '-moveToLocal' is not implemented yet.
What it means
MoveToLocal.processOptions (MoveCommands.java:91) unconditionally throws IOException('Option -moveToLocal is not implemented yet.') before any argument is processed. The remote-to-local move command has never been implemented; its DESCRIPTION is literally 'Not implemented yet'.
Source
Thrown at hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java:91
// we have no way to know the actual error...
PathIOException e = new PathIOException(src.toString());
e.setOperation("remove");
throw e;
}
}
}
/**
* Move remote files to a local filesystem
*/
public static class MoveToLocal extends FsCommand {
public static final String NAME = "moveToLocal";
public static final String USAGE = "<src> <localdst>";
public static final String DESCRIPTION = "Not implemented yet";
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
throw new IOException("Option '-moveToLocal' is not implemented yet.");
}
}
/** move/rename paths on the same filesystem */
public static class Rename extends CommandWithDestination {
public static final String NAME = "mv";
public static final String USAGE = "<src> ... <dst>";
public static final String DESCRIPTION =
"Move files that match the specified file pattern <src> " +
"to a destination <dst>. When moving multiple files, the " +
"destination must be a directory.";
@Override
protected void processOptions(LinkedList<String> args) throws IOException {
CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE);
cf.parse(args);
getRemoteDestination(args);
}View on GitHub (pinned to 2add963021)
Solutions
- Replace with 'hadoop fs -get <src> <localdst>' followed by 'hadoop fs -rm <src>'
- For HDFS-specific work use 'hdfs dfs -get' plus 'hdfs dfs -rm -skipTrash <src>' if trash should be bypassed
- Wrap in a shell function if you want a moveToLocal-style verb: movetolocal() { hadoop fs -get "$1" "$2" && hadoop fs -rm "$1"; }
Example fix
# before hadoop fs -moveToLocal /data/app.log /tmp/ # moveToLocal: Option '-moveToLocal' is not implemented yet. # after hadoop fs -get /data/app.log /tmp/ && hadoop fs -rm /data/app.log
Defensive patterns
Strategy: fallback
Validate before calling
# guard in wrappers: reject moveToLocal before it runs if [[ "$1" == "-moveToLocal" ]]; then echo "not implemented; use get + rm"; exit 2; fi
Try / catch
catch (IOException e) when message contains 'not implemented yet' -> fall back to 'hadoop fs -get' followed by 'hadoop fs -rm'
Prevention
- Never script -moveToLocal; it throws unconditionally
- Implement movetolocal as get+rm in a helper function
When it happens
Trigger: Any invocation of 'hadoop fs -moveToLocal <src> <localdst>' regardless of arguments — the throw happens in processOptions for every call.
Common situations: Operators assuming symmetry with -moveFromLocal; scripts copied from documentation of other tools; porting workflows that used 'hadoop fs -get' and expecting the source to be removed.
Related errors
- Symlinks unsupported
- dump not supported
- This operation is not supported across two different buckets
- This operation is not supported across two different storage
- This operation is not supported across two different storage
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/9385f5c04d70c7b1.
Report an issue: GitHub.