From a91feb89426957e03329a4ba6da99ac363449705 Mon Sep 17 00:00:00 2001 From: Itamar Hartstein Date: Tue, 5 Nov 2024 12:58:00 +0200 Subject: [PATCH] chunks --- macros/edr/system/system_utils/get_config_var.sql | 2 +- macros/utils/list_utils/split_list_to_chunks.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/edr/system/system_utils/get_config_var.sql b/macros/edr/system/system_utils/get_config_var.sql index 91ba75404..65bcac776 100644 --- a/macros/edr/system/system_utils/get_config_var.sql +++ b/macros/edr/system/system_utils/get_config_var.sql @@ -46,7 +46,7 @@ 'long_string_size': 65535, 'collect_model_sql': true, 'query_max_size': 1000000, - 'insert_rows_method': 'max_query_size', + 'insert_rows_method': 'chunk', 'upload_artifacts_method': 'diff', 'project_name': none, 'elementary_full_refresh': false, diff --git a/macros/utils/list_utils/split_list_to_chunks.sql b/macros/utils/list_utils/split_list_to_chunks.sql index b21192ea7..4260230ba 100644 --- a/macros/utils/list_utils/split_list_to_chunks.sql +++ b/macros/utils/list_utils/split_list_to_chunks.sql @@ -12,7 +12,7 @@ {% set current_length = 0 %} {% endif %} {% do current_chunk.append(item) %} - {% do current_length + item | length %} + {% set current_length = current_length + item | length %} {% endfor %} {% if current_chunk %} {% do chunks.append(current_chunk) %}