From a68509b140eade9c7d376e7b84ca396d8b0d6923 Mon Sep 17 00:00:00 2001 From: Nathaniel Richards Date: Fri, 27 Oct 2023 17:29:22 -0500 Subject: [PATCH] Remove type lookup and casting in double loop during INSERT statement when loading dbt seeds. --- .../databricks/macros/materializations/seeds/helpers.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dbt/include/databricks/macros/materializations/seeds/helpers.sql b/dbt/include/databricks/macros/materializations/seeds/helpers.sql index f554b2a55..30483018f 100644 --- a/dbt/include/databricks/macros/materializations/seeds/helpers.sql +++ b/dbt/include/databricks/macros/materializations/seeds/helpers.sql @@ -20,9 +20,7 @@ insert {% if loop.index0 == 0 -%} overwrite {% else -%} into {% endif -%} {{ this.render() }} values {% for row in chunk -%} ({%- for col_name in agate_table.column_names -%} - {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%} - {%- set type = column_override.get(col_name, inferred_type) -%} - cast({{ get_binding_char() }} as {{type}}) + {{ get_binding_char() }} {%- if not loop.last%},{%- endif %} {%- endfor -%}) {%- if not loop.last%},{%- endif %}