From fa9c56a6affaf5f0d2a0c8e66e0c4a6870784929 Mon Sep 17 00:00:00 2001 From: Nathan Villaescusa Date: Sun, 21 Apr 2024 17:16:05 -0700 Subject: [PATCH] Inline --- clients/snowflake/staging.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clients/snowflake/staging.go b/clients/snowflake/staging.go index 55aa87c14..a41151eaf 100644 --- a/clients/snowflake/staging.go +++ b/clients/snowflake/staging.go @@ -48,8 +48,6 @@ func castColValStaging(colVal any, colKind columns.Column, additionalDateFmts [] } func (s *Store) PrepareTemporaryTable(tableData *optimization.TableData, tableConfig *types.DwhTableConfig, tempTableID types.TableIdentifier, additionalSettings types.AdditionalSettings, createTempTable bool) error { - tempTableName := tempTableID.FullyQualifiedName() - if createTempTable { tempAlterTableArgs := ddl.AlterTableArgs{ Dwh: s, @@ -87,7 +85,8 @@ func (s *Store) PrepareTemporaryTable(tableData *optimization.TableData, tableCo // COPY the CSV file (in Snowflake) into a table copyCommand := fmt.Sprintf("COPY INTO %s (%s) FROM (SELECT %s FROM @%s)", - tempTableName, strings.Join(tableData.ReadOnlyInMemoryCols().GetColumnsToUpdate(s.ShouldUppercaseEscapedNames(), &sql.NameArgs{ + tempTableID.FullyQualifiedName(), + strings.Join(tableData.ReadOnlyInMemoryCols().GetColumnsToUpdate(s.ShouldUppercaseEscapedNames(), &sql.NameArgs{ Escape: true, DestKind: s.Label(), }), ","),