truncate
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.
Return
The updated enriched Airbyte value with the truncation applied and recorded.
Parameters
partitionKey
The partition key associated with the record.
stream
The descriptor of the destination stream the value belongs to.
value
The enriched Airbyte value that needs to be truncated.
truncatedValue
The truncated version of the Airbyte value.
reason
The reason for truncating the value, defaulting to DESTINATION_RECORD_SIZE_LIMITATION.