File tree Expand file tree Collapse file tree 6 files changed +12
-20
lines changed Expand file tree Collapse file tree 6 files changed +12
-20
lines changed Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ hashed_columns AS (
438
438
{%- endif - %}
439
439
{%- endif - %}
440
440
441
- {% if enable_ghost_records %}
441
+ {%- if enable_ghost_records and not is_incremental() %}
442
442
{# Creating Ghost Record for unknown case, based on datatype #}
443
443
unknown_values AS (
444
444
@@ -597,7 +597,7 @@ columns_to_select AS (
597
597
598
598
FROM {{ last_cte }}
599
599
600
- {%- if enable_ghost_records %}
600
+ {%- if enable_ghost_records and not is_incremental() %}
601
601
UNION ALL
602
602
603
603
SELECT
Original file line number Diff line number Diff line change @@ -426,7 +426,7 @@ hashed_columns AS (
426
426
{%- endif - %}
427
427
{%- endif - %}
428
428
429
- {% if enable_ghost_records %}
429
+ {%- if enable_ghost_records and not is_incremental() %}
430
430
{# Creating Ghost Record for unknown case, based on datatype #}
431
431
unknown_values AS (
432
432
SELECT
@@ -580,7 +580,7 @@ columns_to_select AS (
580
580
581
581
FROM {{ last_cte }}
582
582
583
- {%- if enable_ghost_records %}
583
+ {%- if enable_ghost_records and not is_incremental() %}
584
584
UNION ALL
585
585
SELECT
586
586
Original file line number Diff line number Diff line change @@ -438,7 +438,7 @@ hashed_columns AS (
438
438
{%- endif - %}
439
439
{%- endif - %}
440
440
441
- {%- if enable_ghost_records - %}
441
+ {%- if enable_ghost_records and not is_incremental() %}
442
442
{# Creating Ghost Record for unknown case, based on datatype #}
443
443
unknown_values AS (
444
444
@@ -597,7 +597,7 @@ columns_to_select AS (
597
597
598
598
FROM {{ last_cte }}
599
599
600
- {% if enable_ghost_records %}
600
+ {%- if enable_ghost_records and not is_incremental() %}
601
601
UNION ALL
602
602
603
603
SELECT
Original file line number Diff line number Diff line change @@ -447,7 +447,7 @@ hashed_columns AS (
447
447
{%- endif - %}
448
448
{%- endif - %}
449
449
450
- {%- if enable_ghost_records - %}
450
+ {%- if enable_ghost_records and not is_incremental() %}
451
451
{# Creating Ghost Record for unknown case, based on datatype #}
452
452
unknown_values AS (
453
453
@@ -606,7 +606,7 @@ columns_to_select AS (
606
606
607
607
FROM {{ last_cte }}
608
608
609
- {%- if enable_ghost_records %}
609
+ {%- if enable_ghost_records and not is_incremental() %}
610
610
UNION ALL
611
611
612
612
SELECT
Original file line number Diff line number Diff line change @@ -389,8 +389,7 @@ hashed_columns AS (
389
389
{%- endif - %}
390
390
{%- endif - %}
391
391
392
- {% if enable_ghost_records %}
393
- {% if not is_incremental() %}
392
+ {%- if enable_ghost_records and not is_incremental() %}
394
393
{# Creating Ghost Record for unknown case, based on datatype #}
395
394
unknown_values AS (
396
395
@@ -535,7 +534,6 @@ ghost_records AS (
535
534
SELECT * FROM error_values
536
535
),
537
536
{%- endif %}
538
- {%- endif %}
539
537
540
538
{%- if not include_source_columns - %}
541
539
{% set source_columns_to_select = datavault4dbt .process_columns_to_select (columns_list= source_columns_to_select, exclude_columns_list= derived_column_names) %}
@@ -551,16 +549,14 @@ columns_to_select AS (
551
549
552
550
FROM {{ last_cte }}
553
551
554
- {% if enable_ghost_records %}
555
- {% if not is_incremental() %}
552
+ {%- if enable_ghost_records and not is_incremental() %}
556
553
UNION ALL
557
554
558
555
SELECT
559
556
560
557
{{ datavault4dbt .print_list (datavault4dbt .escape_column_names (final_columns_to_select)) }}
561
558
562
559
FROM ghost_records
563
- {% endif %}
564
560
{% endif %}
565
561
)
566
562
Original file line number Diff line number Diff line change @@ -439,8 +439,7 @@ hashed_columns AS (
439
439
{% set processed_hash_columns = datavault4dbt .process_hash_column_excludes (hashed_columns) - %}
440
440
{%- endif - %}
441
441
442
- {% if enable_ghost_records %}
443
- {% if not is_incremental() %}
442
+ {%- if enable_ghost_records and not is_incremental() %}
444
443
{# Creating Ghost Record for unknown case, based on datatype #}
445
444
unknown_values AS (
446
445
@@ -585,7 +584,6 @@ ghost_records AS (
585
584
SELECT * FROM error_values
586
585
),
587
586
{%- endif %}
588
- {%- endif %}
589
587
590
588
{%- if not include_source_columns - %}
591
589
{% set final_columns_to_select = datavault4dbt .process_columns_to_select (columns_list= final_columns_to_select, exclude_columns_list= source_columns_to_select) %}
@@ -600,16 +598,14 @@ columns_to_select AS (
600
598
601
599
FROM {{ last_cte }}
602
600
603
- {% if enable_ghost_records %}
604
- {% if not is_incremental() %}
601
+ {%- if enable_ghost_records and not is_incremental() %}
605
602
UNION ALL
606
603
607
604
SELECT
608
605
609
606
{{ datavault4dbt .print_list (datavault4dbt .escape_column_names (final_columns_to_select)) }}
610
607
611
608
FROM ghost_records
612
- {% endif %}
613
609
{% endif %}
614
610
)
615
611
You can’t perform that action at this time.
0 commit comments