File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 99 "sync"
1010 "time"
1111
12+ "github.com/aws/aws-sdk-go/aws"
1213 "github.com/aws/aws-sdk-go/aws/session"
1314 "github.com/aws/aws-sdk-go/service/athena"
1415)
@@ -54,6 +55,9 @@ func init() {
5455// which the driver will poll for results. It should be a time/Duration.String().
5556// A completely arbitrary default of "5s" was chosen.
5657//
58+ // - `region` (optional)
59+ // Override AWS region. Useful if it is not set with environment variable.
60+ //
5761// Credentials must be accessible via the SDK's Default Credential Provider Chain.
5862// For more advanced AWS credentials/session/config management, please supply
5963// a custom AWS session directly via `athena.Open()`.
@@ -123,7 +127,11 @@ func configFromConnectionString(connStr string) (*Config, error) {
123127
124128 var cfg Config
125129
126- cfg .Session , err = session .NewSession ()
130+ var acfg []* aws.Config
131+ if region := args .Get ("region" ); region != "" {
132+ acfg = append (acfg , & aws.Config {Region : aws .String (region )})
133+ }
134+ cfg .Session , err = session .NewSession (acfg ... )
127135 if err != nil {
128136 return nil , err
129137 }
You can’t perform that action at this time.
0 commit comments