Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-898296: Enable HTAP optimisations in tests
Browse files Browse the repository at this point in the history
sfc-gh-pfus committed Sep 6, 2023
1 parent eecf8bf commit 1ad992d
Showing 3 changed files with 17 additions and 4 deletions.
16 changes: 12 additions & 4 deletions connection.go
Original file line number Diff line number Diff line change
@@ -152,10 +152,18 @@ func (sc *snowflakeConn) exec(
}

logger.WithContext(ctx).Info("Exec/Query SUCCESS")
sc.cfg.Database = data.Data.FinalDatabaseName
sc.cfg.Schema = data.Data.FinalSchemaName
sc.cfg.Role = data.Data.FinalRoleName
sc.cfg.Warehouse = data.Data.FinalWarehouseName
if data.Data.FinalDatabaseName != "" {
sc.cfg.Database = data.Data.FinalDatabaseName
}
if data.Data.FinalSchemaName != "" {
sc.cfg.Schema = data.Data.FinalSchemaName
}
if data.Data.FinalWarehouseName != "" {
sc.cfg.Warehouse = data.Data.FinalWarehouseName
}
if data.Data.FinalRoleName != "" {
sc.cfg.Role = data.Data.FinalRoleName
}
sc.populateSessionParameters(data.Data.Parameters)
return data, err
}
2 changes: 2 additions & 0 deletions driver_test.go
Original file line number Diff line number Diff line change
@@ -342,6 +342,8 @@ func runSnowflakeConnTest(t *testing.T, test func(sc *snowflakeConn)) {
t.Fatal(err)
}

sc.Exec("ALTER SESSION SET ENABLE_SNOW_654741_FOR_TESTING = true", nil)

test(sc)
}

3 changes: 3 additions & 0 deletions statement_test.go
Original file line number Diff line number Diff line change
@@ -36,6 +36,9 @@ func openConn(t *testing.T) *sql.Conn {
if conn, err = db.Conn(context.Background()); err != nil {
t.Fatalf("failed to open connection: %v", err)
}

conn.ExecContext(context.Background(), "ALTER SESSION SET ENABLE_SNOW_654741_FOR_TESTING = true")

return conn
}

0 comments on commit 1ad992d

Please sign in to comment.