apache/beam · error · IllegalArgumentException

Unknown timestamp transform case: %s

Error message

Unknown timestamp transform case: %s

What it means

TriggerTranslation.fromProto switches over the TimestampTransformCase of the incoming proto. If the case is set but is not one of the known cases (and not TIMESTAMPTRANSFORM_NOT_SET), the default branch throws an IllegalArgumentException with the actual case name.

Source

Thrown at sdks/java/core/src/main/java/org/apache/beam/sdk/util/construction/TriggerTranslation.java:258

      case AFTER_PROCESSING_TIME:
        AfterProcessingTime trigger = AfterProcessingTime.pastFirstElementInPane();
        for (RunnerApi.TimestampTransform transform :
            triggerProto.getAfterProcessingTime().getTimestampTransformsList()) {
          switch (transform.getTimestampTransformCase()) {
            case ALIGN_TO:
              trigger =
                  trigger.alignedTo(
                      Duration.millis(transform.getAlignTo().getPeriod()),
                      new Instant(transform.getAlignTo().getOffset()));
              break;
            case DELAY:
              trigger = trigger.plusDelayOf(Duration.millis(transform.getDelay().getDelayMillis()));
              break;
            case TIMESTAMPTRANSFORM_NOT_SET:
              throw new IllegalArgumentException(
                  String.format("Required field 'timestamp_transform' not set in %s", transform));
            default:
              throw new IllegalArgumentException(
                  String.format(
                      "Unknown timestamp transform case: %s",
                      transform.getTimestampTransformCase()));
          }
        }
        return trigger;
      case AFTER_SYNCHRONIZED_PROCESSING_TIME:
        return AfterSynchronizedProcessingTime.ofFirstElement();
      case ALWAYS:
        return new ReshuffleTrigger();
      case ELEMENT_COUNT:
        return AfterPane.elementCountAtLeast(triggerProto.getElementCount().getElementCount());
      case NEVER:
        return Never.ever();
      case OR_FINALLY:
        return fromProto(triggerProto.getOrFinally().getMain())
            .orFinally((OnceTrigger) fromProto(triggerProto.getOrFinally().getFinally()));
      case REPEAT:

View on GitHub (pinned to 12126d8942)

Solutions

  1. Upgrade the SDK to a version that recognizes the new TimestampTransformCase
  2. Re-export the pipeline with a Beam version compatible with this SDK
  3. Log the case name and map it manually to an existing transform if a forward-compatible migration is needed

Example fix

// before: proto uses case added in Beam 2.60 read by Beam 2.50
// after: align producer and consumer SDK versions, or upgrade the reader
Defensive patterns

Strategy: type-guard

Validate before calling

TimestampTransform.TimestampTransformCase c = transform.getTimestampTransformCase();
if (c != TimestampTransformCase.TRUNCATE && c != TimestampTransformCase.ALIGNTO
    && c != TimestampTransformCase.TIMESTAMPTRANSFORM_NOT_SET) {
  throw new IllegalStateException("Unknown case, upgrade SDK: " + c);
}

Type guard

boolean isKnownCase(TimestampTransform t) {
  switch (t.getTimestampTransformCase()) {
    case TRUNCATE: case ALIGNTO: case TIMESTAMPTRANSFORM_NOT_SET: return true;
    default: return false;
  }
}

Try / catch

try {
  TriggerTranslation.fromProto(triggerProto);
} catch (IllegalArgumentException e) {
  // upgrade SDK or remap the unknown case
}

Prevention

When it happens

Trigger: Deserializing a TimestampTransform whose oneof case is unrecognized by the running SDK version — typically a case introduced in a newer Beam proto.

Common situations: Version skew between the pipeline producer (newer Beam) and the SDK translating it; custom/forked proto definitions.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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