apache/hadoop · error · IOException

Serializer is not assigable from INativeSerializer

Error message

Serializer is not assigable from INativeSerializer

What it means

Error "Serializer is not assigable from INativeSerializer" thrown in apache/hadoop.

Source

Thrown at hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/java/org/apache/hadoop/mapred/nativetask/serde/NativeSerialization.java:66

    final Class<?> serializer = map.get(name);

    if (null != serializer) {
      try {
        return (INativeSerializer<Writable>) serializer.newInstance();
      } catch (final Exception e) {
        throw new IOException(e);
      }
    }
    return new DefaultSerializer();
  }

  public void register(String klass, Class<?> serializer) throws IOException {
    if (null == klass || null == serializer) {
      throw new IOException("invalid arguments, klass or serializer is null");
    }

    if (!INativeSerializer.class.isAssignableFrom(serializer)) {
      throw new IOException("Serializer is not assigable from INativeSerializer");
    }

    final Class<?> storedSerializer = map.get(klass);
    if (null == storedSerializer) {
      map.put(klass, serializer);
      return;
    } else {
      if (!storedSerializer.getName().equals(serializer.getName())) {
        throw new IOException("Error! Serializer already registered, existing: " +
                              storedSerializer.getName() + ", new: " +
                              serializer.getName());
      }
    }
  }

  public void reset() {
    map.clear();
  }

View on GitHub (pinned to 2add963021)

Solutions

  1. Ensure the serializer class implements INativeSerializer; native tasks require serializers assignable to that interface.
  2. Replace the custom serializer with an INativeSerializer implementation or disable native tasks for this job.

When it happens

Trigger: Thrown by NativeSerialization.register() when the configured serializer class does not implement INativeSerializer. Make the custom serializer implement INativeSerializer before registering it.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/hadoop@2add963021 (2026-08-22). Data as JSON: /api/errors/9ad0bc84a1e9a359. Report an issue: GitHub.