feat: add X-Goog-Request-Reason header support#205
Open
pareshgoogle wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for a requestReason property to the BigQuery JDBC driver. The property is extracted from connection settings and passed through the authorization process to be included as an X-Goog-Request-Reason header in HTTP requests. The HttpRequestTimeoutInitializer was updated to handle this header along with the User-Agent. A new test case confirms the header is correctly sent. I have no feedback to provide.
pareshgoogle
commented
Apr 20, 2026
Contributor
Author
pareshgoogle
left a comment
There was a problem hiding this comment.
This looks good to me as I created the PR
Contributor
|
The change looks good. We might need to fix the Build / test CI as part of this PR. |
c106318 to
467149e
Compare
Contributor
|
CI failed because this PR is from an external fork. I created an internal mirrow PR #207 to move forward. |
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.
Description
This PR adds support for passing the
X-Goog-Request-ReasonHTTP header in BigQuery API requests made by thebqjdbcdriver. A new JDBC connection propertyrequestReasonis introduced to allow users to specify this reason.Changes
BQConnection.java: Updated to parse therequestReasonproperty from the connection URL or properties.Oauth2Bigquery.java: Propagated therequestReasonthrough the authorization flow and injected it as theX-Goog-Request-Reasonheader inHttpRequestTimeoutInitializer.Oauth2Bigquery.java: MaintainedBigQueryRequestUserAgentInitializerfor backward compatibility with existing Looker infrastructure.JdbcUrlTest.java: Added a unit testurlWithRequestReasonSendsHeaderto verify that the header is correctly added to requests.Verification
InaccessibleObjectExceptiondue to running on Java 25 (the project targets Java 8-15, and CI uses Java 1.8). The tests are expected to pass in the CI environment.