Skip to content

Commit

Permalink
snowflake: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rockwotj committed Nov 13, 2024
1 parent 1fd68f0 commit 19d5243
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 10 additions & 8 deletions internal/impl/snowflake/streaming/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,11 @@ func TestIntegerCompat(t *testing.T) {
ctx := context.Background()
restClient, streamClient := setup(t)
channelOpts := streaming.ChannelOptions{
Name: t.Name(),
DatabaseName: envOr("SNOWFLAKE_DB", "BABY_DATABASE"),
SchemaName: "PUBLIC",
TableName: "TEST_INT_TABLE",
Name: t.Name(),
DatabaseName: envOr("SNOWFLAKE_DB", "BABY_DATABASE"),
SchemaName: "PUBLIC",
TableName: "TEST_INT_TABLE",
BuildParallelism: 1,
}
_, err := restClient.RunSQL(ctx, streaming.RunSQLRequest{
Database: channelOpts.DatabaseName,
Expand Down Expand Up @@ -347,10 +348,11 @@ func TestTimestampCompat(t *testing.T) {
ctx := context.Background()
restClient, streamClient := setup(t)
channelOpts := streaming.ChannelOptions{
Name: t.Name(),
DatabaseName: envOr("SNOWFLAKE_DB", "BABY_DATABASE"),
SchemaName: "PUBLIC",
TableName: "TEST_TIMESTAMP_TABLE",
Name: t.Name(),
DatabaseName: envOr("SNOWFLAKE_DB", "BABY_DATABASE"),
SchemaName: "PUBLIC",
TableName: "TEST_TIMESTAMP_TABLE",
BuildParallelism: 1,
}
var columnDefs []string
var columnNames []string
Expand Down
3 changes: 3 additions & 0 deletions internal/impl/snowflake/streaming/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ type encryptionInfo struct {

// OpenChannel creates a new or reuses a channel to load data into a Snowflake table.
func (c *SnowflakeServiceClient) OpenChannel(ctx context.Context, opts ChannelOptions) (*SnowflakeIngestionChannel, error) {
if opts.BuildParallelism <= 0 {
return nil, fmt.Errorf("invalid build parallelism: %d", opts.BuildParallelism)
}
resp, err := c.client.openChannel(ctx, openChannelRequest{
RequestID: c.nextRequestID(),
Role: c.options.Role,
Expand Down

0 comments on commit 19d5243

Please sign in to comment.