merge

Astro SDKCertified

Merge the source table rows into a destination table.

View on GitHub

Last Updated: Aug. 18, 2022

Access Instructions

Install the Astro SDK provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

source_tableRequiredastro.sql.table.TableContains the rows to be merged to the target_table (templated)
target_tableRequiredastro.sql.table.TableContains the destination table in which the rows will be merged (templated)
columnsRequiredList[str] | Tuple[str] | Dict[str, str]List/Tuple of columns if name of source and target tables are same. If the column names in source and target tables are different pass a dictionary of source_table columns names to target_table columns names. Examples: ['sell', 'list'] or {'s_sell': 't_sell', 's_list': 't_list'}
target_conflict_columnsRequiredList[str]List of cols where we expect to have a conflict while combining
if_conflictsRequiredLiteral['ignore', 'update', 'exception']The strategy to be applied if there are conflicts.
kwargsDictAny keyword arguments supported by the BaseOperator is supported (e.g queue, owner)

Documentation

Merge the source table rows into a destination table.

Was this page helpful?