fix(tool/bigquery): handle omitted optional parameters with typed NULLs#3051
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the BigQuery SQL tool to better handle optional parameters and NULL values by introducing a dedicated buildQueryParameters function. It also adds comprehensive unit tests for parameter building. The review feedback correctly identifies a potential issue with named parameter detection using simple string containment, which could lead to false positives, and suggests handling the TypeMap parameter type to prevent potential nil pointer issues.
5a7e82b to
b667ac0
Compare
d041565 to
88c3154
Compare
There was a problem hiding this comment.
Hi @Deeven-Seru, thanks for the PR! We hope to include this fix in the release tomorrow. Let me know if you have any issues fixing the test failures. Otherwise LGTM.
70ad9a2 to
02c44db
Compare
|
hi @duwenxin99 thanks for reviewing. done with final touches, please re initiate the checks |
02c44db to
8919a5f
Compare
|
/gcbrun |
|
/gcbrun |
|
/gcbrun |
|
🎉 |
Description
This PR fixes a runtime
bigquery: nil parametererror that occurred when optional parameters were omitted in BigQuery tool calls. The issue was caused by the tool sending untypednilvalues to the BigQuery API, which the SDK does not accept for parameters.Impact:
IS NULLlogic and optional filters in BigQuery SQL statements.Summary of Solution:
nilvalues to specific BigQuery SDK types (NullString,NullInt64,NullFloat64,NullBool).NullFieldshandling for the low-level REST client to ensureNULLvalues are correctly marshaled during dry runs.bigquerysql_invoke_test.goto validate mapping for all supported scalar and collection types.PR Checklist
!if this involve a breaking change🛠️ Fixes #3033