diff --git a/model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto b/model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto index 22b19ef03289..9ff30966a3e9 100644 --- a/model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto +++ b/model/fn-execution/src/main/proto/org/apache/beam/model/fn_execution/v1/beam_fn_api.proto @@ -757,6 +757,26 @@ message Elements { } } + // The type of change operation represented by a Change Data Capture (CDC) record + message ValueKind { + enum Enum { + // Indicates a new record was created in the source system. + INSERT = 0; + + // Indicates the state of a record immediately before an update occurred. + // This is typically used to identify the previous values of modified columns + // or to locate the record via its primary key. + UPDATE_BEFORE = 1; + + // Indicates the state of a record immediately after an update occurred. + // Represents the current, valid state of the record following the change. + UPDATE_AFTER = 2; + + // Indicates that an existing record was removed from the source system. + DELETE = 3; + } + } + // Element metadata passed as part of WindowedValue to make WindowedValue // extensible and backward compatible message ElementMetadata { @@ -770,6 +790,9 @@ message Elements { // across IOs - Kafka, PubSub, http. // Example value: congo=t61rcWkgMzE optional string tracestate = 3; + // (Optional) The kind of value for CDC metadata. + // If missing or unspecified, implies INSERT for backwards compatibility. + optional ValueKind.Enum value_kind = 4; } // Represent the encoded user timer for a given instruction, transform and