Skip to content

Commit

Permalink
Snowflake session keep-alive
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik committed Mar 10, 2024
1 parent 548f657 commit 814b768
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flow/connectors/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"sync/atomic"
"time"

"github.com/aws/smithy-go/ptr"
"github.com/jackc/pgx/v5/pgtype"
"github.com/snowflakedb/gosnowflake"
"go.temporal.io/sdk/activity"
Expand Down Expand Up @@ -173,6 +174,9 @@ func NewSnowflakeConnector(
return nil, err
}

additionalParams := make(map[string]*string)
additionalParams["CLIENT_SESSION_KEEP_ALIVE"] = ptr.String("true")

snowflakeConfig := gosnowflake.Config{
Account: snowflakeProtoConfig.AccountId,
User: snowflakeProtoConfig.Username,
Expand All @@ -183,7 +187,9 @@ func NewSnowflakeConnector(
Role: snowflakeProtoConfig.Role,
RequestTimeout: time.Duration(snowflakeProtoConfig.QueryTimeout),
DisableTelemetry: true,
Params: additionalParams,
}

snowflakeConfigDSN, err := gosnowflake.DSN(&snowflakeConfig)
if err != nil {
return nil, fmt.Errorf("failed to get DSN from Snowflake config: %w", err)
Expand Down

0 comments on commit 814b768

Please sign in to comment.