{"record":{"id":"4382091ba939e5d7","repo":"apache/beam","slug":"datadogevent-can-hold-arbitrary-instances-which-may-be-non","errorCode":null,"errorMessage":"DatadogEvent can hold arbitrary instances, which may be non-deterministic.","messagePattern":"DatadogEvent can hold arbitrary instances, which may be non-deterministic\\.","errorType":"exception","errorClass":"NonDeterministicException","httpStatus":null,"severity":"warning","filePath":"sdks/java/io/datadog/src/main/java/org/apache/beam/sdk/io/datadog/DatadogEventCoder.java","lineNumber":91,"sourceCode":"      builder.withService(service);\n    }\n\n    String message = STRING_NULLABLE_CODER.decode(in);\n    if (message != null) {\n      builder.withMessage(message);\n    }\n\n    return builder.build();\n  }\n\n  @Override\n  public TypeDescriptor<DatadogEvent> getEncodedTypeDescriptor() {\n    return TYPE_DESCRIPTOR;\n  }\n\n  @Override\n  public void verifyDeterministic() throws NonDeterministicException {\n    throw new NonDeterministicException(\n        this, \"DatadogEvent can hold arbitrary instances, which may be non-deterministic.\");\n  }\n}\n","sourceCodeStart":73,"sourceCodeEnd":95,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/datadog/src/main/java/org/apache/beam/sdk/io/datadog/DatadogEventCoder.java#L73-L95","documentation":"DatadogEventCoder.verifyDeterministic() unconditionally throws NonDeterministicException because DatadogEvent can carry arbitrary Object instances whose serialized bytes may differ between runs. Beam requires deterministic coders for operations like GroupByKey/reshuffle, so this coder declares itself non-deterministic up front.","triggerScenarios":"Using DatadogEvent in an operation that requires deterministic coding, e.g. PCollection<DatadogEvent> followed by GroupByKey, Combine, or a reshuffle that triggers coder.verifyDeterministic().","commonSituations":"Aggregating or deduplicating events before sending to Datadog; adding a shuffle step in a pipeline that previously wrote events directly; Beam upgrading and becoming stricter about coder determinism checks.","solutions":["Avoid GroupByKey/Combine on PCollection<DatadogEvent>; send events directly from each element (DatadogIO.write is designed for that).","Convert events to a deterministic, byte-stable type (e.g. the serialized JSON String or a fixed-field POJO) before shuffling.","Register/override a custom deterministic Coder<DatadogEvent> if you control the event contents."],"exampleFix":"// before\nevents.apply(GroupByKey.create()); // throws NonDeterministicException\n// after\nevents.apply(MapElements.into(TypeDescriptor.of(String.class))\n        .via(event -> event.serializeToJson()))\n    .apply(GroupByKey.create());","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { events.apply(GroupByKey.create()); } catch (NonDeterministicException e) { /* switch to mapping events to deterministic Strings before shuffling */ }","preventionTips":["Never GroupByKey/Combine directly on PCollection<DatadogEvent>.","Convert events to byte-stable representations (JSON String, fixed POJO) before any shuffle.","Review coder requirements when adding aggregation steps to event pipelines."],"tags":["java","beam-io","datadog","coder","determinism"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}