AirbyteValueDeepCoercingMapper

class AirbyteValueDeepCoercingMapper(recurseIntoObjects: Boolean, recurseIntoArrays: Boolean, recurseIntoUnions: Boolean) : AirbyteValueIdentityMapper

A mapper which coerces ALL values against the schema. This mapper MUST NOT be called after any mapper that returns non-native-JSON types (date, timestamp, etc.), or any mapper that causes the values to become misaligned with the schema (e.g. AirbyteSchemaNoopMapper + SchemalessValuesToJsonString).

If this mapper is included in a MapperPipeline, it SHOULD be preceded by a MergeUnions mapper. Not including this mapper may result in strange behavior when coercing union types.

This mapper performs common-sense type coercions. For example, it will promote IntegerValue to NumberValue, or parse StringValue to TimestampValue.

Constructors

Link copied to clipboard
constructor(recurseIntoObjects: Boolean, recurseIntoArrays: Boolean, recurseIntoUnions: Boolean)

Functions

Link copied to clipboard
open override fun map(value: AirbyteValue, schema: AirbyteType, changes: List<Meta.Change>): Pair<AirbyteValue, List<Meta.Change>>
Link copied to clipboard
Link copied to clipboard

Time types are only allowed to be strings on the wire, but can be Int/egerValue if passed through TimeStringToInteger.

Link copied to clipboard
Link copied to clipboard
fun nulledOut(schema: AirbyteType, context: AirbyteValueIdentityMapper.Context, reason: AirbyteRecordMessageMetaChange.Reason = Reason.DESTINATION_SERIALIZATION_ERROR): Pair<AirbyteValue, AirbyteValueIdentityMapper.Context>