apache/beam · error · UnsupportedOperationException

Cannot translate Euphoria 'Join' operator to Beam…

Error message

Cannot translate Euphoria 'Join' operator to Beam transformations. Given join type '${joinType}' is not supported for BroadcastHashJoin.

What it means

The Euphoria Join operator supports only LEFT, RIGHT and FULL join types in BroadcastHashJoinTranslator; any other Join.Type (e.g. INNER) reaches the default branch of the switch and throws UnsupportedOperationException. Beam's broadcast hash join implementation is built around side inputs, which only makes sense for the outer-join variants it implements.

Solutions

  1. Use JoinTranslator's non-broadcast (CoGroup-based) path, which supports INNER joins, instead of the broadcast path
  2. Change the join type to LEFT, RIGHT, or FULL if broadcast semantics are acceptable
  3. Pre-compute the inner-join logic manually with a side input / lookup map in a ParDo
  4. Check operator.getType() before translating and route unsupported types to a different translator

Example fix

// before
Join.of(left, right).by(...).type(Join.Type.INNER).broadcast().apply(...)
// after
Join.of(left, right).by(...).type(Join.Type.INNER).apply(...) // no broadcast hint
Defensive patterns

Strategy: validation

Validate before calling

if (join.getType() == Join.Type.INNER) { throw new IllegalArgumentException("BroadcastHashJoinTranslator supports only LEFT/RIGHT/FULL; use JoinTranslator for INNER"); }

Type guard

boolean isBroadcastSupported(Join.Type t) { return t == Join.Type.LEFT || t == Join.Type.RIGHT || t == Join.Type.FULL; }

Try / catch

try { translate(join); } catch (UnsupportedOperationException e) { /* fall back to CoGroup-based join translation */ }

Prevention

When it happens

Trigger: Translating a Euphoria Join operator with Join.Type.INNER (or any type other than LEFT/RIGHT/FULL) through the BroadcastHashJoinTranslator, i.e. via join with a broadcast hint / JoinTranslator's broadcast path.

Common situations: Developers porting Spark/Flink Euphoria pipelines to Beam using inner joins with broadcast hints; code that assumes all join types are supported on the broadcast path.

Related errors


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

Appendix: source

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

                    new BroadcastHashLeftJoinFn<>(
                        broadcastRight,
                        operator.getJoiner(),
                        accumulators,
                        operator.getName().orElse(null)))
                .withSideInputs(broadcastRight));
      case RIGHT:
        final PCollectionView<Map<KeyT, Iterable<LeftT>>> broadcastLeft =
            computeViewAsMultimapIfAbsent(left, operator.getLeftKeyExtractor(), leftKeyed);
        return rightKeyed.apply(
            ParDo.of(
                    new BroadcastHashRightJoinFn<>(
                        broadcastLeft,
                        operator.getJoiner(),
                        accumulators,
                        operator.getName().orElse(null)))
                .withSideInputs(broadcastLeft));
      default:
        throw new UnsupportedOperationException(
            String.format(
                "Cannot translate Euphoria '%s' operator to Beam transformations."
                    + " Given join type '%s' is not supported for BroadcastHashJoin.",
                Join.class.getSimpleName(), operator.getType()));
    }
  }

  /**
   * Creates new {@link PCollectionView} of given {@code pCollectionToView} iff there is no {@link
   * PCollectionView} already associated with {@code Key}.
   *
   * @param pCollectionToView a {@link PCollection} view will be created from by applying {@link
   *     View#asMultimap()}
   * @param <V> value key type
   * @return the current (already existing or computed) value associated with the specified key
   */
  private <V> PCollectionView<Map<KeyT, Iterable<V>>> computeViewAsMultimapIfAbsent(
      PCollection<V> pcollection,

View on GitHub (pinned to 12126d8942)