Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support float32, float64, and array type query params #2297

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

jackdingilian
Copy link
Contributor

@jackdingilian jackdingilian commented Jul 26, 2024

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:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)
  • Rollback plan is reviewed and LGTMed
  • All new data plane features have a completed end to end testing plan

Fixes #<issue_number_goes_here> ☕️

If you write sample code, please follow the samples format.

Also fixes a bug with float32 lists where it was incorrectly converted to List<Double> where we
expect List<Float>

Change-Id: I4d4b32dcddef74711eeea8997b020c46eee8be3c
@jackdingilian jackdingilian requested review from a team as code owners July 26, 2024 16:23
@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigtable Issues related to the googleapis/java-bigtable API. labels Jul 26, 2024
@jackdingilian jackdingilian added the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 26, 2024
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Jul 26, 2024
@gcf-owl-bot gcf-owl-bot bot requested a review from a team as a code owner July 26, 2024 17:10
private static ArrayValue arrayValueOf(List<?> value, SqlType.Array<?> arrayType) {
ArrayValue.Builder valueBuilder = ArrayValue.newBuilder();
for (Object element : value) {
if (element == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be of a nullValueWithType?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the API only wants the type set on the outermost value, not nested elements

break;
case FLOAT64:
Double doubleElem = (Double) element;
valueBuilder.addValues(Value.newBuilder().setFloatValue(doubleElem).build());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we float64ParamOf(doubleElm)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, because we don't want to set type on the nested elements

@tonytanger
Copy link
Contributor

LGTM

@jackdingilian jackdingilian merged commit a65640e into googleapis:main Jul 31, 2024
21 checks passed
@jackdingilian jackdingilian deleted the add-array-params branch July 31, 2024 14:41
gcf-merge-on-green bot pushed a commit that referenced this pull request Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/java-bigtable API. size: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants