{"record":{"id":"825a4fc9c99a36a7","repo":"apache/hadoop","slug":"output-name-cannot-be-part","errorCode":null,"errorMessage":"output name cannot be 'part'","messagePattern":"output name cannot be 'part'","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/MultipleOutputs.java","lineNumber":250,"sourceCode":"      }\n      if ((ch >= '0') && (ch <= '9')) {\n        continue;\n      }\n      throw new IllegalArgumentException(\n        \"Name cannot be have a '\" + ch + \"' char\");\n    }\n  }\n\n  /**\n   * Checks if output name is valid.\n   *\n   * name cannot be the name used for the default output\n   * @param outputPath base output Name\n   * @throws IllegalArgumentException if the output name is not valid.\n   */\n  private static void checkBaseOutputPath(String outputPath) {\n    if (outputPath.equals(FileOutputFormat.PART)) {\n      throw new IllegalArgumentException(\"output name cannot be 'part'\");\n    }\n  }\n  \n  /**\n   * Checks if a named output name is valid.\n   *\n   * @param namedOutput named output Name\n   * @throws IllegalArgumentException if the output name is not valid.\n   */\n  private static void checkNamedOutputName(JobContext job,\n      String namedOutput, boolean alreadyDefined) {\n    checkTokenName(namedOutput);\n    checkBaseOutputPath(namedOutput);\n    List<String> definedChannels = getNamedOutputsList(job);\n    if (alreadyDefined && definedChannels.contains(namedOutput)) {\n      throw new IllegalArgumentException(\"Named output '\" + namedOutput +\n        \"' already alreadyDefined\");\n    } else if (!alreadyDefined && !definedChannels.contains(namedOutput)) {","sourceCodeStart":232,"sourceCodeEnd":268,"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/output/MultipleOutputs.java#L232-L268","documentation":"Thrown as IllegalArgumentException from MultipleOutputs.checkBaseOutputPath (MultipleOutputs.java:250) when the string equals FileOutputFormat.PART ('part'). 'part' is the reserved prefix of the default output files (part-r-00000 etc.), so named outputs and base output paths may not claim it verbatim; otherwise output would collide with the framework's default channel.","triggerScenarios":"mos.write(\"channel\", key, value, \"part\") with baseOutputPath exactly 'part'; or addNamedOutput(job, \"part\", ...) — checkNamedOutputName applies checkBaseOutputPath to the channel name too. Substrings like 'partA' or 'part-r-5' are fine.","commonSituations":"Generic write helpers that pass a fixed base name 'part' assuming it works like the default output; migrating code from direct context.write() where 'part' is the implicit name.","solutions":["Rename the base path to anything except exactly 'part': 'mypart', 'part-agg', 'data'","If you wanted the default channel, use context.write(key, value) instead of MultipleOutputs"],"exampleFix":"// before\nmos.write(\"summary\", key, value, \"part\");\n\n// after\nmos.write(\"summary\", key, value, \"summary-part\");","handlingStrategy":"validation","validationCode":"// guard the reserved default-output name\nstatic String requireBasePath(String p) {\n  if (FileOutputFormat.PART.equals(p)) throw new IllegalArgumentException(\"baseOutputPath 'part' is reserved\");\n  return p;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pass exactly 'part' as channel name or base path","Use the default context.write() for the default channel"],"tags":["hadoop","mapreduce","multiple-outputs","validation","reserved-name","illegalargument"],"backgroundTag":"invalid-named-output-name","analyzedSha":"2add9630210752f88ceb1bb74eb65e37bf41da8e","analyzedAt":"2026-08-22T19:55:07.957Z","schemaVersion":2},"datasetVersion":"2026-08-22T20:17:22.307Z"}