Skip to content

Commit

Permalink
Merge pull request #80 from oracle/dev/1.4.2
Browse files Browse the repository at this point in the history
Parallel hints should be after MERGE and INSERT keyword
  • Loading branch information
aosingh authored Mar 23, 2023
2 parents 7518bcb + 6e36e88 commit e8c8809
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
{%- set target_relation = args_dict["target_relation"] -%}
{%- set dest_column_names = dest_columns | map(attribute='name') | list -%}
{%- set dest_cols_csv = get_quoted_column_csv(model, dest_column_names) -%}
INSERT INTO {% if parallel %} /*+parallel({{ parallel }})*/ {% endif %} {{ target_relation }} ({{ dest_cols_csv }})
INSERT {% if parallel %} /*+PARALLEL({{ parallel }})*/ {% endif %} INTO {{ target_relation }} ({{ dest_cols_csv }})
(
SELECT {{ dest_cols_csv }}
FROM {{ temp_relation }}
Expand All @@ -122,7 +122,7 @@
{%- set unique_key_result = oracle_check_and_quote_unique_key_for_incremental_merge(unique_key, incremental_predicates) -%}
{%- set unique_key_list = unique_key_result['unique_key_list'] -%}
{%- set unique_key_merge_predicates = unique_key_result['unique_key_merge_predicates'] -%}
merge into {% if parallel %} /*+parallel({{ parallel }})*/ {% endif %} {{ target_relation }} DBT_INTERNAL_DEST
merge {% if parallel %} /*+parallel({{ parallel }})*/ {% endif %} into {{ target_relation }} DBT_INTERNAL_DEST
using {{ temp_relation }} DBT_INTERNAL_SOURCE
on ({{ unique_key_merge_predicates | join(' AND ') }})
when matched then
Expand All @@ -138,7 +138,7 @@
{% endfor -%}
)
{%- else -%}
insert into {% if parallel %} /*+parallel({{ parallel }})*/ {% endif %} {{ target_relation }} ({{ dest_cols_csv }})
insert {% if parallel %} /*+parallel({{ parallel }})*/ {% endif %} into {{ target_relation }} ({{ dest_cols_csv }})
(
select {{ dest_cols_csv }}
from {{ temp_relation }}
Expand Down

0 comments on commit e8c8809

Please sign in to comment.