feat(bqjdbc): Bypass dry-run job for read-only tokens.#12961
feat(bqjdbc): Bypass dry-run job for read-only tokens.#12961
Conversation
There was a problem hiding this comment.
Code Review
This pull request implements detection for read-only OAuth tokens by parsing JWT scopes within the BigQuery JDBC connection. When such a token is identified, the system skips dry runs and assumes a SELECT statement type to avoid errors. The review feedback identifies several critical issues, including potential NullPointerException vulnerabilities in the new fromValue and token check methods, and a regression where numeric OAuthType values are no longer supported. Additionally, suggestions were made to follow Java naming conventions and to refine exception handling by avoiding generic catches.
1bf43f8 to
a5a7650
Compare
b1f841f to
b149d90
Compare
52ec632 to
ef7530b
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for read-only OAuth access tokens by adding a new OAuthAccessTokenReadonly connection property and adjusting query execution logic to bypass dry runs and explicit job creation when such tokens are used. Feedback indicates that the changes in BigQueryStatement globally enforce stateless query mode, which inadvertently disables custom Job ID generation for users with standard tokens. It is recommended to restore the conditional logic to preserve backward compatibility for non-read-only scenarios.
This allows driver to be used with tokens created for read-only scope. Note that this scope is not recommended by BigQuery, so it should not be used unless absolutely necessary.
This will be removed in the future.
List of changes:
queryWithTimeout. This method is usingcreateunder the cover in some cases. The only difference is that now we can't provide custom JobID. I think it is ok for consistency between modes