From d0cc5a91df926976c7018a351bf44f159bfa7873 Mon Sep 17 00:00:00 2001 From: Shivam Raj Date: Wed, 2 Apr 2025 01:24:37 +0530 Subject: [PATCH 1/2] enable cloud fetch by default and add useLZ4Compression option to session parameters --- lib/DBSQLClient.ts | 2 +- lib/DBSQLSession.ts | 2 +- lib/contracts/IDBSQLSession.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/DBSQLClient.ts b/lib/DBSQLClient.ts index 85888d16..8d981fd1 100644 --- a/lib/DBSQLClient.ts +++ b/lib/DBSQLClient.ts @@ -88,7 +88,7 @@ export default class DBSQLClient extends EventEmitter implements IDBSQLClient, I retryDelayMin: 1 * 1000, // 1 second retryDelayMax: 60 * 1000, // 60 seconds (1 minute) - useCloudFetch: false, + useCloudFetch: true, // enabling cloud fetch by default. cloudFetchConcurrentDownloads: 10, useLZ4Compression: true, diff --git a/lib/DBSQLSession.ts b/lib/DBSQLSession.ts index 768b6b5e..009a8c8b 100644 --- a/lib/DBSQLSession.ts +++ b/lib/DBSQLSession.ts @@ -202,7 +202,7 @@ export default class DBSQLSession implements IDBSQLSession { ...getArrowOptions(clientConfig), canDownloadResult: options.useCloudFetch ?? clientConfig.useCloudFetch, parameters: getQueryParameters(options.namedParameters, options.ordinalParameters), - canDecompressLZ4Result: clientConfig.useLZ4Compression && Boolean(LZ4), + canDecompressLZ4Result: (options.useLZ4Compression ?? clientConfig.useLZ4Compression) && Boolean(LZ4), }); const response = await this.handleResponse(operationPromise); const operation = this.createOperation(response); diff --git a/lib/contracts/IDBSQLSession.ts b/lib/contracts/IDBSQLSession.ts index 8a0d8bf0..0f751714 100644 --- a/lib/contracts/IDBSQLSession.ts +++ b/lib/contracts/IDBSQLSession.ts @@ -17,6 +17,7 @@ export type ExecuteStatementOptions = { runAsync?: boolean; maxRows?: number | bigint | Int64 | null; useCloudFetch?: boolean; + useLZ4Compression?: boolean; stagingAllowedLocalPath?: string | string[]; namedParameters?: Record; ordinalParameters?: Array; From 8c7f30644aff398fd03b76c757b409e563f12b7f Mon Sep 17 00:00:00 2001 From: Shivam Raj Date: Wed, 2 Apr 2025 02:28:35 +0530 Subject: [PATCH 2/2] remove compression changes --- lib/DBSQLSession.ts | 2 +- lib/contracts/IDBSQLSession.ts | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/DBSQLSession.ts b/lib/DBSQLSession.ts index 009a8c8b..768b6b5e 100644 --- a/lib/DBSQLSession.ts +++ b/lib/DBSQLSession.ts @@ -202,7 +202,7 @@ export default class DBSQLSession implements IDBSQLSession { ...getArrowOptions(clientConfig), canDownloadResult: options.useCloudFetch ?? clientConfig.useCloudFetch, parameters: getQueryParameters(options.namedParameters, options.ordinalParameters), - canDecompressLZ4Result: (options.useLZ4Compression ?? clientConfig.useLZ4Compression) && Boolean(LZ4), + canDecompressLZ4Result: clientConfig.useLZ4Compression && Boolean(LZ4), }); const response = await this.handleResponse(operationPromise); const operation = this.createOperation(response); diff --git a/lib/contracts/IDBSQLSession.ts b/lib/contracts/IDBSQLSession.ts index 0f751714..8a0d8bf0 100644 --- a/lib/contracts/IDBSQLSession.ts +++ b/lib/contracts/IDBSQLSession.ts @@ -17,7 +17,6 @@ export type ExecuteStatementOptions = { runAsync?: boolean; maxRows?: number | bigint | Int64 | null; useCloudFetch?: boolean; - useLZ4Compression?: boolean; stagingAllowedLocalPath?: string | string[]; namedParameters?: Record; ordinalParameters?: Array;