apache/beam · error · IllegalStateException

Unable to find translator for basic operator

Error message

Unable to find translator for basic operator [${operatorClass}] with name [${operatorName}]

What it means

OperatorTransform.apply looks up a translator for a Euphoria operator via TranslatorProvider/Visitor; if no translator is registered for the operator's class it throws IllegalStateException. Every basic operator must have a matching translator in the provider registry.

Solutions

  1. Register a translator for the operator class in your TranslatorProvider/builder
  2. Use a built-in Euphoria operator instead of the custom one
  3. Check that the provider passed to OperatorTransform includes the needed translator (e.g. via DefaultTranslatorProvider)
  4. Ensure operator.getClass() matches the class key used at registration (no anonymous/subclass mismatch)

Example fix

// before
TranslatorProvider provider = DefaultTranslatorProvider.of(); // custom Op has no translator
// after
TranslatorProvider provider = TranslatorProvider CompositeBuilder of(DefaultTranslatorProvider.of())
    .addTranslator(Op.class, new OpTranslator()).build();
Defensive patterns

Strategy: validation

Validate before calling

if (provider.findTranslator(operator.getClass()) == null) { throw new IllegalArgumentException("No translator registered for " + operator.getClass()); }

Type guard

boolean hasTranslator(Operator<?> op, TranslatorProvider p) { return p.findTranslator(op.getClass()) != null; }

Try / catch

try { OperatorTransform.apply(operator, input, context); } catch (IllegalStateException e) { /* register translator or fall back to built-in operator */ }

Prevention

When it happens

Trigger: Calling pipeline.apply(operator output) with a custom operator subclass or an operator whose translator is not registered in the TranslatorProvider passed to the translation.

Common situations: Adding a new custom Euphoria operator without registering its translator; wiring the wrong TranslatorProvider into a test or pipeline; typos in translator registration.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/b99f9e533460baa6. Report an issue: GitHub.

Appendix: source

Thrown at sdks/java/extensions/euphoria/src/main/java/org/apache/beam/sdk/extensions/euphoria/core/translate/OperatorTransform.java:59

  public static <InputT, OutputT, OperatorT extends Operator<OutputT>> PCollection<OutputT> apply(
      OperatorT operator, PCollectionList<InputT> inputs) {

    final Optional<OperatorTranslator<InputT, OutputT, OperatorT>> maybeTranslator =
        TranslatorProvider.of(inputs.getPipeline()).findTranslator(operator);

    if (maybeTranslator.isPresent()) {
      final PCollection<OutputT> output =
          inputs.apply(
              operator.getName().orElseGet(() -> operator.getClass().getName()),
              new OperatorTransform<>(operator, maybeTranslator.orElse(null)));
      Preconditions.checkState(
          output.getTypeDescriptor() != null,
          "Translator should always return a typed PCollection.");
      return output;
    }

    throw new IllegalStateException(
        "Unable to find translator for basic operator ["
            + operator.getClass()
            + "] with name ["
            + operator.getName().orElse(null)
            + "]");
  }

  private final OperatorT operator;
  private final OperatorTranslator<InputT, OutputT, OperatorT> translator;

  private OperatorTransform(
      OperatorT operator, OperatorTranslator<InputT, OutputT, OperatorT> translator) {
    this.operator = operator;
    this.translator = translator;
  }

  @Override
  public PCollection<OutputT> expand(PCollectionList<InputT> inputs) {

View on GitHub (pinned to 12126d8942)