MapReduce local running path configuration error java.io.IOException: (null) entry in command string: null ls -F

问题
Error while running command to get file permissions : java.io.IOException: (null) entry in command string: null ls -F

Configure the path before modification:

//本地运行输入路径配置
TextInputFormat.addInputPath(job, new Path("file:///D:\\IdeaWorkSpace\\bigDate\\data\\sort\\sort_input"));

Causes and solutions

  1. No specific path is specified. If there is only a single file, the path can be written to the specific file to the path
    as follows:
//本地运行输入路径配置
TextInputFormat.addInputPath(job, new Path("file:///D:\\IdeaWorkSpace\\bigDate\\data\\sort\\sort_input\\1.txt"));
  1. If need to read multiple files in the file directory path and finally add \\*
    asTextInputFormat.addInputPath(job, new Path("file:///D:\\IdeaWorkSpace\\bigDate\\data\\sort\\sort_input\\*"));
//本地运行输入路径配置
TextInputFormat.addInputPath(job, new Path("file:///D:\\IdeaWorkSpace\\bigDate\\data\\sort\\sort_input\\*"));

So you can read the contents of all files under sort_input

Guess you like

Origin blog.csdn.net/qq_38454176/article/details/105882232