{"record":{"id":"9385f5c04d70c7b1","repo":"apache/hadoop","slug":"option-movetolocal-is-not-implemented-yet","errorCode":null,"errorMessage":"Option '-moveToLocal' is not implemented yet.","messagePattern":"Option '-moveToLocal' is not implemented yet\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java","lineNumber":91,"sourceCode":"        // we have no way to know the actual error...\n        PathIOException e = new PathIOException(src.toString());\n        e.setOperation(\"remove\");\n        throw e;\n      }\n    }\n  }\n\n  /**\n   *  Move remote files to a local filesystem\n   */\n  public static class MoveToLocal extends FsCommand { \n    public static final String NAME = \"moveToLocal\";\n    public static final String USAGE = \"<src> <localdst>\";\n    public static final String DESCRIPTION = \"Not implemented yet\";\n\n    @Override\n    protected void processOptions(LinkedList<String> args) throws IOException {\n      throw new IOException(\"Option '-moveToLocal' is not implemented yet.\");\n    }\n  }\n\n  /** move/rename paths on the same filesystem */\n  public static class Rename extends CommandWithDestination {\n    public static final String NAME = \"mv\";\n    public static final String USAGE = \"<src> ... <dst>\";\n    public static final String DESCRIPTION = \n      \"Move files that match the specified file pattern <src> \" +\n      \"to a destination <dst>.  When moving multiple files, the \" +\n      \"destination must be a directory.\";\n\n    @Override\n    protected void processOptions(LinkedList<String> args) throws IOException {\n      CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE);\n      cf.parse(args);\n      getRemoteDestination(args);\n    }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/MoveCommands.java#L73-L109","documentation":"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'.","triggerScenarios":"Any invocation of 'hadoop fs -moveToLocal <src> <localdst>' regardless of arguments — the throw happens in processOptions for every call.","commonSituations":"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.","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\"; }"],"exampleFix":"# before\nhadoop fs -moveToLocal /data/app.log /tmp/\n# moveToLocal: Option '-moveToLocal' is not implemented yet.\n\n# after\nhadoop fs -get /data/app.log /tmp/ && hadoop fs -rm /data/app.log","handlingStrategy":"fallback","validationCode":"# guard in wrappers: reject moveToLocal before it runs\nif [[ \"$1\" == \"-moveToLocal\" ]]; then echo \"not implemented; use get + rm\"; exit 2; fi","typeGuard":null,"tryCatchPattern":"catch (IOException e) when message contains 'not implemented yet' -> fall back to 'hadoop fs -get' followed by 'hadoop fs -rm'","preventionTips":["Never script -moveToLocal; it throws unconditionally","Implement movetolocal as get+rm in a helper function"],"tags":["movetolocal","not-implemented","hadoop-shell","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}