Skip to content

Commit 394eb84

Browse files
authored
fix(prestodb/trino-driver): Specify correct timeouts for query execution (cube-js#9827)
By default, it's specified as 60 seconds in presto-client. It uses a timer and cancels queries after it.
1 parent 4647ea3 commit 394eb84

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/cubejs-prestodb-driver/src/PrestoDriver.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,14 @@ export class PrestoDriver extends BaseDriver implements DriverInterface {
113113
secretAccessKey: getEnv('dbExportBucketAwsSecret', { dataSource }),
114114
exportBucketRegion: getEnv('dbExportBucketAwsRegion', { dataSource }),
115115
credentials: getEnv('dbExportGCSCredentials', { dataSource }),
116+
queryTimeout: getEnv('dbQueryTimeout', { dataSource }),
116117
...config
117118
};
118119
this.catalog = this.config.catalog;
119-
this.client = new presto.Client(this.config);
120+
this.client = new presto.Client({
121+
timeout: this.config.queryTimeout,
122+
...this.config,
123+
});
120124
}
121125

122126
public async testConnection(): Promise<void> {
@@ -319,7 +323,7 @@ export class PrestoDriver extends BaseDriver implements DriverInterface {
319323

320324
const { schema, tableName } = this.splitTableFullName(params.tableFullName);
321325
const tableWithCatalogAndSchema = `${this.config.catalog}.${schema}.${tableName}`;
322-
326+
323327
const protocol = {
324328
gcs: 'gs',
325329
s3: this.config.exportBucketS3AdvancedFS ? 's3a' : 's3'

0 commit comments

Comments
 (0)