{"record":{"id":"29fdeebeb35a8f47","repo":"apache/hadoop","slug":"input-key-is-null","errorCode":null,"errorMessage":"input key is null","messagePattern":"input key is null","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/util/SizedWritable.java","lineNumber":46,"sourceCode":"public class SizedWritable<T> {\n  public static final int INVALID_LENGTH = -1;\n\n  public int length = INVALID_LENGTH;\n  public Writable v;\n\n  public SizedWritable(Class<?> klass) {\n    if (null != klass) {\n      v = (Writable) ReflectionUtils.newInstance(klass, null);\n    }\n    length = INVALID_LENGTH;\n  }\n\n  public void readFields(DataInputBuffer key) throws IOException {\n    if (null != key) {\n      this.v.readFields(key);\n      this.length = INVALID_LENGTH;\n    } else {\n      throw new IOException(\"input key is null\");\n    }\n\n  }\n\n  public void reset(T w) {\n    this.v = (Writable) w;\n    this.length = INVALID_LENGTH;\n  }\n}\n","sourceCodeStart":28,"sourceCodeEnd":56,"githubUrl":"https://github.com/apache/hadoop/blob/2add9630210752f88ceb1bb74eb65e37bf41da8e/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/util/SizedWritable.java#L28-L56","documentation":"Error \"input key is null\" thrown in apache/hadoop.","triggerScenarios":"Thrown by SizedWritable constructor when a null key Writable is passed in. nativetask requires non-null keys; filter out null keys before writing to the native collector.","commonSituations":"See trigger scenarios.","solutions":["Set the key on SizedWritable before serializing; ensure map output keys are never null.","Guard the mapper output so context.write() is never called with a null key."],"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-22T20:17:22.307Z"}