apache/hadoop · error · IllegalArgumentException
output name cannot be 'part'
Error message
output name cannot be 'part'
What it means
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.
Source
Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/output/MultipleOutputs.java:250
}
if ((ch >= '0') && (ch <= '9')) {
continue;
}
throw new IllegalArgumentException(
"Name cannot be have a '" + ch + "' char");
}
}
/**
* Checks if output name is valid.
*
* name cannot be the name used for the default output
* @param outputPath base output Name
* @throws IllegalArgumentException if the output name is not valid.
*/
private static void checkBaseOutputPath(String outputPath) {
if (outputPath.equals(FileOutputFormat.PART)) {
throw new IllegalArgumentException("output name cannot be 'part'");
}
}
/**
* Checks if a named output name is valid.
*
* @param namedOutput named output Name
* @throws IllegalArgumentException if the output name is not valid.
*/
private static void checkNamedOutputName(JobContext job,
String namedOutput, boolean alreadyDefined) {
checkTokenName(namedOutput);
checkBaseOutputPath(namedOutput);
List<String> definedChannels = getNamedOutputsList(job);
if (alreadyDefined && definedChannels.contains(namedOutput)) {
throw new IllegalArgumentException("Named output '" + namedOutput +
"' already alreadyDefined");
} else if (!alreadyDefined && !definedChannels.contains(namedOutput)) {View on GitHub (pinned to 2add963021)
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
Example fix
// before
mos.write("summary", key, value, "part");
// after
mos.write("summary", key, value, "summary-part"); Defensive patterns
Strategy: validation
Validate before calling
// guard the reserved default-output name
static String requireBasePath(String p) {
if (FileOutputFormat.PART.equals(p)) throw new IllegalArgumentException("baseOutputPath 'part' is reserved");
return p;
} Prevention
- Never pass exactly 'part' as channel name or base path
- Use the default context.write() for the default channel
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Name cannot be NULL or emtpy
- Name cannot be have a '{ch}' char
- Name cannot be NULL or emtpy
- Name cannot be have a '{}' char
- Named output name cannot be 'part'
AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22).
Data as JSON: /api/errors/825a4fc9c99a36a7.
Report an issue: GitHub.