From 56219a5d38181392299b32419ffe4fe6b0eb5957 Mon Sep 17 00:00:00 2001 From: achettyiitr Date: Mon, 9 Dec 2024 19:27:43 +0530 Subject: [PATCH] chore: add columns in one go instead of adding it single --- .../asyncdestinationmanager/snowpipestreaming/channel.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go b/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go index 9ff65581bb9..5e01150e443 100644 --- a/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go +++ b/router/batchrouter/asyncdestinationmanager/snowpipestreaming/channel.go @@ -65,10 +65,8 @@ func (m *Manager) addColumns(ctx context.Context, namespace, tableName string, c defer func() { snowflakeManager.Cleanup(ctx) }() - for _, column := range columns { - if err = snowflakeManager.AddColumns(ctx, tableName, []whutils.ColumnInfo{column}); err != nil { - return fmt.Errorf("adding column: %w", err) - } + if err = snowflakeManager.AddColumns(ctx, tableName, columns); err != nil { + return fmt.Errorf("adding column: %w", err) } return nil }