feat: Support float32, float64, and array type query params#2297
Merged
jackdingilian merged 2 commits intogoogleapis:mainfrom Jul 31, 2024
Merged
feat: Support float32, float64, and array type query params#2297jackdingilian merged 2 commits intogoogleapis:mainfrom
jackdingilian merged 2 commits intogoogleapis:mainfrom
Conversation
Also fixes a bug with float32 lists where it was incorrectly converted to List<Double> where we expect List<Float> Change-Id: I4d4b32dcddef74711eeea8997b020c46eee8be3c
tonytanger
reviewed
Jul 29, 2024
| private static ArrayValue arrayValueOf(List<?> value, SqlType.Array<?> arrayType) { | ||
| ArrayValue.Builder valueBuilder = ArrayValue.newBuilder(); | ||
| for (Object element : value) { | ||
| if (element == null) { |
Contributor
There was a problem hiding this comment.
Should this be of a nullValueWithType?
Contributor
Author
There was a problem hiding this comment.
No, the API only wants the type set on the outermost value, not nested elements
tonytanger
reviewed
Jul 29, 2024
| break; | ||
| case FLOAT64: | ||
| Double doubleElem = (Double) element; | ||
| valueBuilder.addValues(Value.newBuilder().setFloatValue(doubleElem).build()); |
Contributor
There was a problem hiding this comment.
Could we float64ParamOf(doubleElm)?
Contributor
Author
There was a problem hiding this comment.
No, because we don't want to set type on the nested elements
Contributor
|
LGTM |
igorbernstein2
approved these changes
Jul 31, 2024
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Aug 6, 2024
🤖 I have created a release *beep* *boop* --- ## [2.42.0](https://togithub.com/googleapis/java-bigtable/compare/v2.41.0...v2.42.0) (2024-08-06) ### Features * Support float32, float64, and array type query params ([#2297](https://togithub.com/googleapis/java-bigtable/issues/2297)) ([a65640e](https://togithub.com/googleapis/java-bigtable/commit/a65640e285950d02136544bac913b2852cfe0274)) ### Bug Fixes * Adapt toString tests to introduction of java.time in gax ([93f66a7](https://togithub.com/googleapis/java-bigtable/commit/93f66a70371f8095fd5c001a977d71e5622be46d)) ### Dependencies * Update shared dependencies ([93f66a7](https://togithub.com/googleapis/java-bigtable/commit/93f66a70371f8095fd5c001a977d71e5622be46d)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
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.
Also fixes a bug with float32 lists where it was incorrectly converted to List of Double where we expect List of Float
Change-Id: I4d4b32dcddef74711eeea8997b020c46eee8be3c
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️
If you write sample code, please follow the samples format.