Skip to content

Commit ccf62a9

Browse files
Default value of RowsFetchedPerBlock changed to 100K (#1001)
## Description RowsFetchedPerBlock denotes the max rows that JDBC buffers in memory when running in Arrow disabled inline mode. 100K default captures typical use cases with an efficient balance between execution time and memory usage. ## Testing <!-- Describe how the changes have been tested--> ## Additional Notes to the Reviewer <!-- Share any additional context or insights that may help the reviewer understand the changes better. This could include challenges faced, limitations, or compromises made during the development process. Also, mention any areas of the code that you would like the reviewer to focus on specifically. -->
1 parent 718060e commit ccf62a9

6 files changed

Lines changed: 19 additions & 11 deletions

File tree

.github/workflows/releaseFreeze.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
# GITHUB_HEAD_REF: Source branch name for PRs
2222
PR_BRANCH: ${{ github.head_ref }}
2323
run: |
24-
CONFIG_FILE="development/.release-config.json"
24+
CONFIG_FILE="development/.release-freeze.json"
2525
2626
if [[ ! -f "$CONFIG_FILE" ]]; then
2727
echo "✅ No release config file - passing check."

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
### Updated
1818
- Databricks SDK dependency upgraded to latest version 0.60.0
19+
- Updated the default value of RowsFetchedPerBlock to 100K from 2M to capture typical cases and balance memory usage.
1920

2021
### Fixed
2122
- Integrated Azure U2M flow into driver for improved stability.

development/.release-freeze.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"freeze": true,
33
"reason": "Releasing JDBC - 16th Sep",
4-
"allow_list": []
5-
}
4+
"allow_list": ["jayantsing-db/default-max-rows-per-block"]
5+
}

src/main/java/com/databricks/jdbc/common/DatabricksJdbcUrlParams.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public enum DatabricksJdbcUrlParams {
123123
ROWS_FETCHED_PER_BLOCK(
124124
"RowsFetchedPerBlock",
125125
"The maximum number of rows that a query returns at a time.",
126-
"2000000"), // works only for inline results.
126+
"100000"), // works only for inline results.
127127
AZURE_WORKSPACE_RESOURCE_ID(
128128
"azure_workspace_resource_id", "Resource ID of Azure Databricks workspace"),
129129
AZURE_TENANT_ID("AzureTenantId", "Azure tenant ID"),

src/test/java/com/databricks/jdbc/api/impl/DatabricksConnectionContextTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ public void testRowsFetchedPerBlock() throws DatabricksSQLException {
342342
DatabricksConnectionContext connectionContext =
343343
(DatabricksConnectionContext)
344344
DatabricksConnectionContext.parse(TestConstants.VALID_CLUSTER_URL, properties);
345-
assertEquals(2000000, connectionContext.getRowsFetchedPerBlock());
345+
assertEquals(100000, connectionContext.getRowsFetchedPerBlock());
346346

347347
// Test with custom value
348348
Properties properties = new Properties();

src/test/java/com/databricks/jdbc/integration/IntegrationTestUtil.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.databricks.jdbc.integration;
22

33
import static com.databricks.jdbc.common.DatabricksJdbcConstants.*;
4+
import static com.databricks.jdbc.common.EnvironmentVariables.DEFAULT_ROW_LIMIT_PER_BLOCK;
45
import static com.databricks.jdbc.integration.fakeservice.FakeServiceConfigLoader.*;
56
import static com.databricks.jdbc.integration.fakeservice.FakeServiceExtension.TARGET_URI_PROP_SUFFIX;
67

@@ -200,15 +201,18 @@ public static Connection getValidJDBCConnection() throws SQLException {
200201
DatabricksJdbcUrlParams.ENABLE_SQL_EXEC_HYBRID_RESULTS.getParamName(), '0');
201202

202203
if (DriverUtil.isRunningAgainstFake()) {
203-
connectionProperties.put(
204+
connectionProperties.putIfAbsent(
204205
DatabricksJdbcUrlParams.CONN_CATALOG.getParamName(),
205206
FakeServiceConfigLoader.getProperty(DatabricksJdbcUrlParams.CONN_CATALOG.getParamName()));
206-
connectionProperties.put(
207+
connectionProperties.putIfAbsent(
207208
DatabricksJdbcUrlParams.CONN_SCHEMA.getParamName(),
208209
FakeServiceConfigLoader.getProperty(DatabricksJdbcUrlParams.CONN_SCHEMA.getParamName()));
209-
connectionProperties.put(
210+
connectionProperties.putIfAbsent(
210211
DatabricksJdbcUrlParams.USE_THRIFT_CLIENT.getParamName(),
211212
FakeServiceConfigLoader.shouldUseThriftClient());
213+
connectionProperties.putIfAbsent(
214+
DatabricksJdbcUrlParams.ROWS_FETCHED_PER_BLOCK.getParamName(),
215+
DEFAULT_ROW_LIMIT_PER_BLOCK);
212216

213217
return DriverManager.getConnection(getFakeServiceJDBCUrl(), connectionProperties);
214218
}
@@ -233,15 +237,18 @@ public static Connection getValidJDBCConnection(Properties connectionProperties)
233237
DatabricksJdbcUrlParams.ENABLE_SQL_EXEC_HYBRID_RESULTS.getParamName(), '0');
234238

235239
if (DriverUtil.isRunningAgainstFake()) {
236-
connectionProperties.put(
240+
connectionProperties.putIfAbsent(
237241
DatabricksJdbcUrlParams.CONN_CATALOG.getParamName(),
238242
FakeServiceConfigLoader.getProperty(DatabricksJdbcUrlParams.CONN_CATALOG.getParamName()));
239-
connectionProperties.put(
243+
connectionProperties.putIfAbsent(
240244
DatabricksJdbcUrlParams.CONN_SCHEMA.getParamName(),
241245
FakeServiceConfigLoader.getProperty(DatabricksJdbcUrlParams.CONN_SCHEMA.getParamName()));
242-
connectionProperties.put(
246+
connectionProperties.putIfAbsent(
243247
DatabricksJdbcUrlParams.USE_THRIFT_CLIENT.getParamName(),
244248
FakeServiceConfigLoader.shouldUseThriftClient());
249+
connectionProperties.putIfAbsent(
250+
DatabricksJdbcUrlParams.ROWS_FETCHED_PER_BLOCK.getParamName(),
251+
DEFAULT_ROW_LIMIT_PER_BLOCK);
245252

246253
return DriverManager.getConnection(getFakeServiceJDBCUrl(), connectionProperties);
247254
}

0 commit comments

Comments
 (0)