Skip to content

Added optional EnableSQLValidationForIsValid property for isValid() to allow users to enable server-side SQL validation#961

Merged
msrathore-db merged 15 commits into
databricks:mainfrom
msrathore-db:PECOBLR-772
Sep 2, 2025
Merged

Added optional EnableSQLValidationForIsValid property for isValid() to allow users to enable server-side SQL validation#961
msrathore-db merged 15 commits into
databricks:mainfrom
msrathore-db:PECOBLR-772

Conversation

@msrathore-db
Copy link
Copy Markdown
Collaborator

@msrathore-db msrathore-db commented Aug 25, 2025

Description

Added SQL execution based isValid check gated by a connection property EnableSQLValidationForIsValid. This allows users to enable server-side SQL validation of isValid(). The validation is based on the execution of SELECT VERSION() query for optimised latency.
This is an optional property. The default behaviour is not changed for isValid()

Testing

Tested manually using a large query to check if the timeout functions well.

RELATED TICKETS AND DOCUMENTS

PECOBLR-772
ES-1361851

Comment thread src/main/java/com/databricks/jdbc/api/impl/DatabricksConnection.java Outdated
Comment thread README.md
Comment thread src/main/java/com/databricks/jdbc/api/impl/DatabricksConnection.java Outdated
Comment thread NEXT_CHANGELOG.md Outdated
stmt.setQueryTimeout(timeout);
stmt.execute("SELECT VERSION()");
return true;
} catch (SQLException e) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how are we distinguishing client/server side exceptions

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're returning false for all exceptions.

Comment thread src/main/java/com/databricks/jdbc/api/internal/IDatabricksConnectionContext.java Outdated
Comment thread src/main/java/com/databricks/jdbc/api/impl/DatabricksConnectionContext.java Outdated
Comment thread src/main/java/com/databricks/jdbc/api/impl/DatabricksConnection.java Outdated
Comment thread src/main/java/com/databricks/jdbc/common/DatabricksJdbcConstants.java Outdated
Copy link
Copy Markdown
Collaborator

@shivam2680 shivam2680 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment thread src/main/java/com/databricks/jdbc/model/telemetry/DriverConnectionParameters.java Outdated
Copy link
Copy Markdown
Collaborator

@samikshya-db samikshya-db left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks !

@msrathore-db msrathore-db merged commit 27b656b into databricks:main Sep 2, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants