From 394eb84910160e86e4634df6bcc78c7ac803803b Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 29 Jul 2025 12:20:01 +0200 Subject: [PATCH] fix(prestodb/trino-driver): Specify correct timeouts for query execution (#9827) By default, it's specified as 60 seconds in presto-client. It uses a timer and cancels queries after it. --- packages/cubejs-prestodb-driver/src/PrestoDriver.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/cubejs-prestodb-driver/src/PrestoDriver.ts b/packages/cubejs-prestodb-driver/src/PrestoDriver.ts index 2490d99473fdb..8c4da89e3a451 100644 --- a/packages/cubejs-prestodb-driver/src/PrestoDriver.ts +++ b/packages/cubejs-prestodb-driver/src/PrestoDriver.ts @@ -113,10 +113,14 @@ export class PrestoDriver extends BaseDriver implements DriverInterface { secretAccessKey: getEnv('dbExportBucketAwsSecret', { dataSource }), exportBucketRegion: getEnv('dbExportBucketAwsRegion', { dataSource }), credentials: getEnv('dbExportGCSCredentials', { dataSource }), + queryTimeout: getEnv('dbQueryTimeout', { dataSource }), ...config }; this.catalog = this.config.catalog; - this.client = new presto.Client(this.config); + this.client = new presto.Client({ + timeout: this.config.queryTimeout, + ...this.config, + }); } public async testConnection(): Promise { @@ -319,7 +323,7 @@ export class PrestoDriver extends BaseDriver implements DriverInterface { const { schema, tableName } = this.splitTableFullName(params.tableFullName); const tableWithCatalogAndSchema = `${this.config.catalog}.${schema}.${tableName}`; - + const protocol = { gcs: 'gs', s3: this.config.exportBucketS3AdvancedFS ? 's3a' : 's3'