Repository navigation
Conversation
…try in integration tests
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors and refines telemetry recording and error handling in the BigQuery JDBC driver. Key changes include caching DatabaseMetaData in BigQueryDriver to prevent redundant fetches, throwing a BigQueryJdbcException instead of returning null on connection failures, and introducing an internal cancel method to avoid logging telemetry during housekeeping statement closures. Additionally, telemetry tracking has been added for parameter binding and corrected in pooled connections to prevent double-counting. Comprehensive unit tests have been added to verify these behaviors. There are no review comments to assess, so I have no additional feedback to provide.
logachev
approved these changes
Nov 6, 2026
keshavdandeva
approved these changes
Nov 9, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Telemetry count fixes
BigQueryDriver.connect: fetchDatabaseMetaDataonce for the startup log line instead offour times, so a new connection no longer records 4×
DRIVER_FEATURE_METADATA_RETRIEVAL.BigQueryDriver.connect: resolveAuthenticationTypeimmediately after URL parsing so failedConnectionAttemptrecords carry the real auth type instead ofAUTHENTICATION_TYPE_UNSPECIFIED.BigQueryDriver.connect: throwBigQueryJdbcExceptiononIOExceptioninstead of returningnull, as JDBC requires for an accepted URL that fails. Behaviour change for callers thatrelied on the
nullreturn.BigQueryStatement:cancel()now recordsDRIVER_FEATURE_STATEMENT_CANCELand delegates to anew private
cancelInternal();close()callscancelInternal()directly, so closing astatement is no longer counted as a user-initiated cancel.
BigQueryPooledConnection: remove theDRIVER_FEATURE_METADATA_RETRIEVALrecord from thepooled wrapper's
getMetaData(); the delegate already records it (was double-counted).BigQueryParameterHandler.setParameter(int, Object, Class): recordDRIVER_FEATURE_PARAMETER_BINDINGlike the other three overloads. This is the path behindPreparedStatement.setInt/setLong/setString/..., so the most common bindings were uncounted.Build
pom.xml: set system propertyBIGQUERY_JDBC_TELEMETRY_ENABLED=falsein the failsafeconfiguration so integration tests do not emit usage telemetry. Test-only; does not affect the
published artifact or end users.
Tests
mockStatic(TelemetryManager)for each fix above. Existingtelemetry tests only asserted
TelemetryManager.isInitialized(), which is why none of thesewere caught.
BigQueryDriverTest: introduceVALID_TOKEN_URLand reuse it in the four tests that inlinedthe same URL; cover the
IOExceptionpath by stubbingBigQueryJdbcRootLogger.setLevel.BigQueryStatementTest: addassertFeatureRecorded(action, feature, expectedCount)helper.BigQueryPooledConnectionTest: assert the wrapper delegates and records nothing itself.