Skip to content

Commit 037ef04

Browse files
committed
Fix athena issue where it could not connect
1 parent 6d02766 commit 037ef04

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

config.yml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
interval: '5m'
129129
connections:
130130
# see https://godoc.org/github.com/segmentio/go-athena#Driver.Open
131-
- 'athena://HOST_VALUE_IGNORED/<DB_NAME>?db=<DB_NAME>&region=<AWS_REGION>&output_location=s3://aws-athena-query-results-<ACCOUNT_ID>-<REGION>'
131+
- 'athena://?db=<DB_NAME>&region=<AWS_REGION>&output_location=s3://aws-athena-query-results-<ACCOUNT_ID>-<REGION>'
132132
queries:
133133
- name: "athena_query_rows"
134134
help: "Number of rows..."

job.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,7 @@ func (j *Job) updateConnections() {
441441
user: user,
442442
}
443443
if newConn.driver == "athena" {
444-
// call go-athena's Open() to ensure conn.db is set,
445-
// otherwise API calls will complain about an empty database field:
446-
// "InvalidParameter: 1 validation error(s) found. - minimum field size of 1, StartQueryExecutionInput.QueryExecutionContext.Database."
447-
newConn.conn, err = sqlx.Open("athena", u.String())
444+
newConn.conn, err = sqlx.Open("athena", u.RawQuery)
448445
if err != nil {
449446
level.Error(j.log).Log("msg", "Failed to open Athena connection", "connection", conn, "err", err)
450447
continue

0 commit comments

Comments
 (0)