DirectLoadTableDedupTruncateStreamLoader

class DirectLoadTableDedupTruncateStreamLoader(val stream: DestinationStream, initialStatus: DirectLoadInitialStatus, realTableName: TableName, tempTableName: TableName, columnNameMapping: ColumnNameMapping, schemaEvolutionClient: TableSchemaEvolutionClient, tableOperationsClient: TableOperationsClient, streamStateStore: StreamStateStore<DirectLoadTableExecutionConfig>, tempTableNameGenerator: TempTableNameGenerator) : StreamLoader

Stream loader implementation for deduplication + truncate mode.

This loader provides the most complex functionality, combining both deduplication and table truncation. It writes to a temporary table first, then depending on generation IDs and table status, follows different strategies:

  1. May upsert directly to the real table if appropriate

  2. May create a real table and upsert into it

  3. May use a temp-temp table approach to ensure proper deduplication before overwriting the real table

This strategy ensures optimal performance while maintaining data integrity across various scenarios, including interrupted syncs and schema changes.

Constructors

Link copied to clipboard
constructor(stream: DestinationStream, initialStatus: DirectLoadInitialStatus, realTableName: TableName, tempTableName: TableName, columnNameMapping: ColumnNameMapping, schemaEvolutionClient: TableSchemaEvolutionClient, tableOperationsClient: TableOperationsClient, streamStateStore: StreamStateStore<DirectLoadTableExecutionConfig>, tempTableNameGenerator: TempTableNameGenerator)

Properties

Link copied to clipboard
open override val stream: DestinationStream

Functions

Link copied to clipboard
open suspend override fun close(hadNonzeroRecords: Boolean, streamFailure: StreamProcessingFailed?)
Link copied to clipboard
open suspend override fun start()
Link copied to clipboard
open suspend fun teardown(completedSuccessfully: Boolean)