This repository was archived by the owner on Sep 2, 2025. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed 
dbt/include/bigquery/macros/materializations Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 6969
7070{% endmacro %}
7171
72+ 
73+ {% macro generate_temp_schema(base_relation, temp_schema =  none) %}
74+   {%-  if temp_schema is not none- %}
75+       {%-  set  temp_relation =  base_relation .incorporate (path = {
76+         " schema"  : temp_schema
77+         }) - %}
78+         {%-  do create_schema(temp_relation) - %}
79+   {% endif %}
80+ {% endmacro %}
81+ 
7282{% materialization incremental, adapter= ' bigquery'  , supported_languages= [' sql'  , ' python'  ] - %}
7383
7484  {%-  set  unique_key =  config .get (' unique_key'  ) - %}
75-   {%-  set  temp_schema  =  config .get (' temp_schema '  ) - %}
85+   {%-  set  tmp_schema  =  config .get (' tmp_schema '  ) - %}
7686  {%-  set  full_refresh_mode =  (should_full_refresh()) - %}
7787  {%-  set  language =  model[' language'  ] %}
7888
7989  {%-  set  target_relation =  this %}
8090  {%-  set  existing_relation =  load_relation(this) %}
81-   {%-  set  temp_schema =  config .get (' temp_schema'  ) - %}
82-   {%-  if temp_schema is not none- %}
83-       {%-  set  temp_relation =  this .incorporate (path = {
84-         " schema"  : temp_schema
85-         }) - %}
86-         {%-  do create_schema(temp_relation) - %}
87-   {% endif %}
88-   {%-  set  tmp_relation =  make_temp_relation(temp_relation) %}
91+   {%-  set  tmp_updated_relation =  generate_tmp_schema(this, tmp_schema) - %}
92+   {%-  set  tmp_relation =  make_temp_relation(tmp_updated_relation) %}
8993
9094  {# -- Validate early so we don't run SQL if the strategy is invalid --#}
9195  {% set  strategy =  dbt_bigquery_validate_get_incremental_strategy(config) - %}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments