ValidationResultHandler

@Singleton
class ValidationResultHandler(stateAdditionalStatsStore: StateAdditionalStatsStore)

Handles validation results by appropriately performing actions such as truncating, nullifying, or leaving values unchanged. Updates internal state statistics based on the applied actions.

Parameters

stateAdditionalStatsStore

Store for tracking additional statistics related to state changes.

Constructors

Link copied to clipboard
constructor(stateAdditionalStatsStore: StateAdditionalStatsStore)

Creates an instance of ValidationResultHandler with the provided state statistics store.

Functions

Link copied to clipboard

Handles the provided validation result for a given value, partition, and stream.

Link copied to clipboard
fun nullify(partitionKey: PartitionKey, stream: DestinationStream.Descriptor, value: EnrichedAirbyteValue, reason: AirbyteRecordMessageMetaChange.Reason = Reason.DESTINATION_SERIALIZATION_ERROR): EnrichedAirbyteValue

Nullifies the provided enriched Airbyte value by setting its value to null and recording the change. Additionally, updates the state statistics for the nullification event.

Link copied to clipboard
fun truncate(partitionKey: PartitionKey, stream: DestinationStream.Descriptor, value: EnrichedAirbyteValue, truncatedValue: AirbyteValue, reason: AirbyteRecordMessageMetaChange.Reason = Reason.DESTINATION_RECORD_SIZE_LIMITATION): EnrichedAirbyteValue

Truncates the provided enriched Airbyte value to adhere to a specified limit. Records the truncation event as a change and updates the state statistics for the truncation event.