feat(bigtable): Add Execute method to execute GoogleSQL queries#11883
Merged
bhshkh merged 14 commits intogoogleapis:mainfrom Mar 27, 2025
Merged
feat(bigtable): Add Execute method to execute GoogleSQL queries#11883bhshkh merged 14 commits intogoogleapis:mainfrom
bhshkh merged 14 commits intogoogleapis:mainfrom
Conversation
5328d3a to
f7476eb
Compare
8eb4ea1 to
e8ea433
Compare
gkevinzheng
reviewed
Mar 25, 2025
jackdingilian
requested changes
Mar 25, 2025
jackdingilian
requested changes
Mar 27, 2025
jackdingilian
left a comment
There was a problem hiding this comment.
Mostly Looking good, just want to resolve comment about potential race condition on refresh
gkevinzheng
approved these changes
Mar 27, 2025
bigtable/bigtable.go
Outdated
| // Make a deep copy. Even if preparedStatement is refreshed, this wouldn't change | ||
| metadata: proto.Clone(metadata).(*btpb.ResultSetMetadata), | ||
| preparedQuery: query, | ||
| metadata: proto.Clone(ps.data.metadata).(*btpb.ResultSetMetadata), |
There was a problem hiding this comment.
I think there is still a race here. If ps.data is updated between accessing the metadata and the preparedQuery.
We need to do
data = ps.data
return {
data.preparedQuery,
data.metadata,
...
}
jackdingilian
approved these changes
Mar 27, 2025
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.
To execute a SQL query, user needs to
The "Prepare" step takes a SQL query text and some additional information and returns some state and an execution plan. Essentially, it processes the query and sets up what is needed to run it, before the actual execution of the query occurs.
This PR adds support for the third step.
Most of the implementation of
func (bs *BoundStatement) executeis similar to readrowsmethod on ResultRow to access the results will be added in next PR: #11924 .
More context:
feat(bigtable): Add datatypes for GoogleSQL #11816
feat(bigtable): Add PrepareStatement to run GoogleSQL queries #11829
feat(bigtable): Add Bind function to bind query params #11862
chore(bigtable): Refactor tests and mark SQL rpcs unimplemented in emulator #11892