{"record":{"id":"f729382ce0be01f6","repo":"apache/hadoop","slug":"not-a-file","errorCode":null,"errorMessage":"Not a file: {}","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/mapred/FileInputFormat.java","lineNumber":346,"sourceCode":"\n  /** Splits files returned by {@link #listStatus(JobConf)} when\n   * they're too big.*/ \n  public InputSplit[] getSplits(JobConf job, int numSplits)\n    throws IOException {\n    StopWatch sw = new StopWatch().start();\n    FileStatus[] stats = listStatus(job);\n\n    // Save the number of input files for metrics/loadgen\n    job.setLong(NUM_INPUT_FILES, stats.length);\n    long totalSize = 0;                           // compute total size\n    boolean ignoreDirs = !job.getBoolean(INPUT_DIR_RECURSIVE, false)\n      && job.getBoolean(INPUT_DIR_NONRECURSIVE_IGNORE_SUBDIRS, false);\n\n    List<FileStatus> files = new ArrayList<>(stats.length);\n    for (FileStatus file: stats) {                // check we have valid files\n      if (file.isDirectory()) {\n        if (!ignoreDirs) {\n          throw new IOException(\"Not a file: \"+ file.getPath());\n        }\n      } else {\n        files.add(file);\n        totalSize += file.getLen();\n      }\n    }\n\n    long goalSize = totalSize / (numSplits == 0 ? 1 : numSplits);\n    long minSize = Math.max(job.getLong(org.apache.hadoop.mapreduce.lib.input.\n      FileInputFormat.SPLIT_MINSIZE, 1), minSplitSize);\n\n    // generate splits\n    ArrayList<FileSplit> splits = new ArrayList<FileSplit>(numSplits);\n    NetworkTopology clusterMap = new NetworkTopology();\n    for (FileStatus file: files) {\n      Path path = file.getPath();\n      long length = file.getLen();\n      if (length != 0) {","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileInputFormat.java#L328-L364","documentation":"Error \"Not a file: {}\" thrown in apache/hadoop.","triggerScenarios":"Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/FileInputFormat.java:346 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Point the input path at a regular file, not a directory; if a directory was intended, use an InputFormat that expands directories.","Check the path for typos and confirm it exists on the filesystem with the expected type."],"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"}