Repository navigation
Conversation
) BigQuery clients send scalar parameter values as JSON strings, so googlesqlite inferred STRING for parameters declared NUMERIC/BIGNUMERIC. Wrap named occurrences of those parameters in an explicit cast (and cast array elements individually) before sending the query to the analyzer, and type empty numeric arrays as string slices. Refs #8
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.
What
The BigQuery REST API encodes scalar query-parameter values as JSON strings. googlesqlite inferred the parameter type from that Go value, so a parameter declared
NUMERIC/BIGNUMERICwas analysed asSTRINGand failed in arithmetic or typed comparisons.This wraps named occurrences of declared numeric parameters in an explicit
CASTbefore the query reaches the analyzer; arrays are replaced with an equivalent array whose elements are cast individually. The value encoding is unchanged, so NULL/empty handling is preserved.Changes
internal/contentdata/repository.go: query rewrite for declared numeric parameters (scalar and array), typed empty numeric arrays.server/server_test.go:TestNumericQueryParametercovers scalarNUMERIC, scalarBIGNUMERIC(large precision) and an arrayNUMERICparameter through the REST query endpoint.Verification
go test ./server ./internal/... ./types— all green.Stack
Rung 3, based on
stack/02-cdc-load-options(PR #13). Next: #9 (creation_timetyping). Upstream context: goccy#511 (open), plus open PRs goccy#516/goccy#525/goccy#526.Refs #8