diff --git a/projects/vdk-plugins/vdk-trino/src/vdk/plugin/trino/templates/load/dimension/scd1_upsert/02-requisite-sql-scripts/02-create-table-and-insert-data.sql b/projects/vdk-plugins/vdk-trino/src/vdk/plugin/trino/templates/load/dimension/scd1_upsert/02-requisite-sql-scripts/02-create-table-and-insert-data.sql index cbaec554ed..9f42cdf1b3 100644 --- a/projects/vdk-plugins/vdk-trino/src/vdk/plugin/trino/templates/load/dimension/scd1_upsert/02-requisite-sql-scripts/02-create-table-and-insert-data.sql +++ b/projects/vdk-plugins/vdk-trino/src/vdk/plugin/trino/templates/load/dimension/scd1_upsert/02-requisite-sql-scripts/02-create-table-and-insert-data.sql @@ -1,12 +1,12 @@ CREATE TABLE "{target_schema_staging}"."{target_table_staging}" AS ( -SELECT t.* +SELECT t.* FROM "{target_schema}"."{target_table}" AS t LEFT JOIN "{source_schema}"."{source_view}" AS s ON s."{id_column}" = t."{id_column}" WHERE s."{id_column}" IS NULL ) UNION ALL ( -SELECT * +SELECT * FROM "{source_schema}"."{source_view}" ) diff --git a/projects/vdk-plugins/vdk-trino/tests/jobs/load_dimension_scd1_upsert_template_job/02_run_load_dimension_scd1_template.py b/projects/vdk-plugins/vdk-trino/tests/jobs/load_dimension_scd1_upsert_template_job/02_run_load_dimension_scd1_template.py index 9eb275d71e..ef46f1ce7d 100644 --- a/projects/vdk-plugins/vdk-trino/tests/jobs/load_dimension_scd1_upsert_template_job/02_run_load_dimension_scd1_template.py +++ b/projects/vdk-plugins/vdk-trino/tests/jobs/load_dimension_scd1_upsert_template_job/02_run_load_dimension_scd1_template.py @@ -1,4 +1,4 @@ -#TODO Align with the upsert tempalte +# TODO Align with the upsert tempalte # Copyright 2023-2024 Broadcom # SPDX-License-Identifier: Apache-2.0 from vdk.api.job_input import IJobInput diff --git a/projects/vdk-plugins/vdk-trino/tests/test_vdk_templates.py b/projects/vdk-plugins/vdk-trino/tests/test_vdk_templates.py index 8d7aef3684..7e8f5492c7 100644 --- a/projects/vdk-plugins/vdk-trino/tests/test_vdk_templates.py +++ b/projects/vdk-plugins/vdk-trino/tests/test_vdk_templates.py @@ -631,7 +631,6 @@ def test_insert_clean_staging(self) -> None: second_exec, f"Clean up of staging table - {staging_table_name} is not made properly. Different data was found in the table after consecutive executions.", ) - def test_scd_upsert(self) -> None: test_schema = self.__schema @@ -657,7 +656,6 @@ def test_scd_upsert(self) -> None: actual, expected, f"Elements in {expect_table} and {target_table} differ." ) - def __scd_upsert_execute( self, test_schema,