{"record":{"id":"6c83493bab90eb59","repo":"apache/hadoop","slug":"not-a-file-filename","errorCode":null,"errorMessage":"Not a file: {fileName}","messagePattern":"Not a file: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java","lineNumber":96,"sourceCode":"   * @see FileInputFormat#getSplits(JobContext)\n   */\n  public List<InputSplit> getSplits(JobContext job)\n  throws IOException {\n    List<InputSplit> splits = new ArrayList<InputSplit>();\n    int numLinesPerSplit = getNumLinesPerSplit(job);\n    for (FileStatus status : listStatus(job)) {\n      splits.addAll(getSplitsForFile(status,\n        job.getConfiguration(), numLinesPerSplit));\n    }\n    return splits;\n  }\n  \n  public static List<FileSplit> getSplitsForFile(FileStatus status,\n      Configuration conf, int numLinesPerSplit) throws IOException {\n    List<FileSplit> splits = new ArrayList<FileSplit> ();\n    Path fileName = status.getPath();\n    if (status.isDirectory()) {\n      throw new IOException(\"Not a file: \" + fileName);\n    }\n    LineReader lr = null;\n    try {\n      final FutureDataInputStreamBuilder builder =\n          fileName.getFileSystem(conf).openFile(fileName);\n      FutureIO.propagateOptions(builder, conf,\n          MRJobConfig.INPUT_FILE_OPTION_PREFIX,\n          MRJobConfig.INPUT_FILE_MANDATORY_PREFIX);\n      FSDataInputStream in  = FutureIO.awaitFuture(builder.build());\n      lr = new LineReader(in, conf);\n      Text line = new Text();\n      int numLines = 0;\n      long begin = 0;\n      long length = 0;\n      int num = -1;\n      while ((num = lr.readLine(line)) > 0) {\n        numLines++;\n        length += num;","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java#L78-L114","documentation":"Error \"Not a file: {fileName}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/input/NLineInputFormat.java:96 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every path given to NLineInputFormat is a regular file, not a directory; correct or remove the offending path."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}