DestinationStream

data class DestinationStream(val unmappedNamespace: String?, val unmappedName: String, val importType: ImportType, val schema: AirbyteType, val generationId: Long, val minimumGenerationId: Long, val syncId: Long, val isFileBased: Boolean = false, val includeFiles: Boolean = false, val destinationObjectName: String? = null, val matchingKey: List<String>? = null, namespaceMapper: NamespaceMapper, val tableSchema: StreamTableSchema)

Internal representation of destination streams. This is intended to be a case class specialized for usability.

NOTE ON NAMESPACE MAPPING:

When run in speed mode (io.airbyte.cdk.load.config.DataChannelMedium = SOCKET), namespace mapping will be applied in the destination instead of in the orchestrator. The entails

  • the platform will give the destination a catalog with an unmapped namespace and stream names

  • the source will send the destination records and control messages with unmapped namespace and stream names

  • the destination will apply the namespace mapping as soon as it receives these messages (all of its written data/table names/object paths will use the mapped namespace and names, same as in a non-speed sync)

  • when the destination emits control messages (state, stats), it must use the unmapped namespace and names More generally: all inter-application communication will be unmapped, all communication between the connector and the destination, or between the CDK and the connector code, will be mapped.

TO MAKE THIS AS ERROR-PROOF AS POSSIBLE:

  • every DestinationStream must be instantiated with an unmappedName, unmappedNamespace, AND a NamespaceMapper

  • the default namespace mapper will be identity, and will work as expected for standard syncs

  • DestinationStream.Descriptor will ALWAYS be MAPPED. (All code and tests should follow this pattern.)

  • NamespaceMapper is treated as data for the purpose of equality checks (ie, same unmapped names + and same mapping rules => same stream)

  • currently this won't impact the ordering of stream names for AirbyteValueProxy.FieldAccessor s, but only because the only stream name mapping currently supported is prepending a uniform prefix. IF THAT CHANGES, PROXY FIELD ORDERING WILL BREAK.

Constructors

Link copied to clipboard
constructor(unmappedNamespace: String?, unmappedName: String, importType: ImportType, schema: AirbyteType, generationId: Long, minimumGenerationId: Long, syncId: Long, isFileBased: Boolean = false, includeFiles: Boolean = false, destinationObjectName: String? = null, matchingKey: List<String>? = null, namespaceMapper: NamespaceMapper, tableSchema: StreamTableSchema)

Types

Link copied to clipboard
data class Descriptor(val namespace: String?, val name: String)

Properties

Link copied to clipboard

Provides the schema in a stable order, which can be used to query the AirbyteValueProxy representation of the data provided by DestinationRecordRaw. This can also be used to build a header/ordered schema as needed.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val includeFiles: Boolean = false
Link copied to clipboard
val isFileBased: Boolean = false
Link copied to clipboard
val matchingKey: List<String>? = null
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun asProtocolObject(): ConfiguredAirbyteStream

This is not fully round-trippable. Destinations don't care about most of the stuff in an AirbyteStream (e.g. we don't care about defaultCursorField, we only care about the actual cursor field; we don't care about the source sync mode, we only care about the destination sync mode; etc.).