Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/cubejs-athena-driver/src/AthenaDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ interface AthenaDriverOptions extends AthenaClientConfig {
workGroup?: string
catalog?: string
schema?: string
database?: string
S3OutputLocation?: string
exportBucket?: string
pollTimeout?: number
Expand Down Expand Up @@ -147,6 +148,9 @@ export class AthenaDriver extends BaseDriver implements DriverInterface {
catalog:
config.catalog ||
getEnv('athenaAwsCatalog', { dataSource }),
database:
config.database ||
getEnv('dbName', { dataSource }),
exportBucket:
config.exportBucket ||
getEnv('dbExportBucket', { dataSource }),
Expand Down Expand Up @@ -477,7 +481,10 @@ export class AthenaDriver extends BaseDriver implements DriverInterface {
ResultConfiguration: {
OutputLocation: this.config.S3OutputLocation
},
...(this.config.catalog != null ? { QueryExecutionContext: { Catalog: this.config.catalog } } : {})
QueryExecutionContext: {
Catalog: this.config.catalog,
Database: this.config.database
}
};
const { QueryExecutionId } = await this.athena.startQueryExecution(request);
return { QueryExecutionId: checkNonNullable('StartQueryExecution', QueryExecutionId) };
Expand Down
Loading