Skip to content

Commit c04e909

Browse files
gopalldbclaude
andauthored
Downgrade FetchSize log messages from WARN to DEBUG (#1237)
## Summary - Downgrade `setFetchSize()` and `getFetchSize()` log messages from `WARN` to `DEBUG` in both `DatabricksStatement` and `DatabricksResultSet` - SQLWarnings are still added per JDBC spec so callers can discover the unsupported feature ## Root Cause BI tools like Metabase call `setFetchSize()`/`getFetchSize()` on every query as part of standard JDBC usage. Each call logged a WARN-level message, flooding logs with thousands of warnings for expected, harmless behavior. ## Test plan - [x] `DatabricksStatementTest` — 83 tests pass - [x] `DatabricksResultSetTest` — 53 tests pass Fixes #1208 🤖 Generated with [Claude Code](https://claude.com/claude-code) NO_CHANGELOG=true Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3aec164 commit c04e909

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/main/java/com/databricks/jdbc/api/impl/DatabricksResultSet.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,15 +760,19 @@ public void setFetchSize(int rows) throws SQLException {
760760
Hence, we don't support it.*/
761761
LOGGER.debug("public void setFetchSize(int rows = {})", rows);
762762
checkIfClosed();
763-
addWarningAndLog("As FetchSize is not supported in the Databricks JDBC, ignoring it");
763+
String warningString = "As FetchSize is not supported in the Databricks JDBC, ignoring it";
764+
LOGGER.debug(warningString);
765+
warnings = WarningUtil.addWarning(warnings, warningString);
764766
}
765767

766768
@Override
767769
public int getFetchSize() throws SQLException {
768770
LOGGER.debug("public int getFetchSize()");
769771
checkIfClosed();
770-
addWarningAndLog(
771-
"As FetchSize is not supported in the Databricks JDBC, we don't set it in the first place");
772+
String warningString =
773+
"As FetchSize is not supported in the Databricks JDBC, we don't set it in the first place";
774+
LOGGER.debug(warningString);
775+
warnings = WarningUtil.addWarning(warnings, warningString);
772776
return 0;
773777
}
774778

src/main/java/com/databricks/jdbc/api/impl/DatabricksStatement.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public void setFetchSize(int rows) {
350350
LOGGER.debug(String.format("public void setFetchSize(int rows = {%s})", rows));
351351
String warningString = "As FetchSize is not supported in the Databricks JDBC, ignoring it";
352352

353-
LOGGER.warn(warningString);
353+
LOGGER.debug(warningString);
354354
warnings = WarningUtil.addWarning(warnings, warningString);
355355
}
356356

@@ -360,7 +360,7 @@ public int getFetchSize() {
360360
String warningString =
361361
"As FetchSize is not supported in the Databricks JDBC, we don't set it in the first place";
362362

363-
LOGGER.warn(warningString);
363+
LOGGER.debug(warningString);
364364
warnings = WarningUtil.addWarning(warnings, warningString);
365365
return 0;
366366
}

0 commit comments

Comments
 (0)