Skip to content

feat(bigtable): add view_parameters support to BoundStatement#13673

Merged
mutianf merged 14 commits into
googleapis:mainfrom
ad548:feat-view-parameters
Jul 22, 2026
Merged

feat(bigtable): add view_parameters support to BoundStatement#13673
mutianf merged 14 commits into
googleapis:mainfrom
ad548:feat-view-parameters

Conversation

@ad548

@ad548 ad548 commented Jul 7, 2026

Copy link
Copy Markdown
Member

This PR ports the Java client changes supporting view_parameters in ExecuteQueryRequest (originally developed and reviewed internally in CL 13080 / branch add-view-parameters-support).

Changes

  • Added view_parameters support to BoundStatement and its builder.
  • Updated BoundStatementTest with unit tests for view_parameters.
  • Updated BoundStatementDeserializer in test-proxy to handle view_parameters.

Verification

  • Confirmed ExecuteQueryRequest in generated GAPIC proto library already contains view_parameters support.
  • Verified compilation and build across google-cloud-bigtable and dependencies.

@ad548
ad548 requested review from a team as code owners July 7, 2026 02:22

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for view parameters in SQL BoundStatements, introducing the viewParameters field, builder methods to set them, and updating the proto serialization and test proxy deserializer. A review comment correctly points out that the newly added public method setViewParameter(String, Value) lacks direct unit test coverage and provides a helpful code suggestion to test this single-parameter setter.

We need to add support for `view_parameters` in the Java Bigtable client library and the Java Test Proxy to unblock Centigrate testing. Note that the backend Bigtable server currently only supports String typed view parameters.

1. In the Java client library (`BoundStatement.java`):
   - Update `BoundStatement` and its `Builder` to support storing `view_parameters`.
   - Implement runtime type validation in `setViewParameter` to check `value.getKindCase() == Value.KindCase.STRING_VALUE`, throwing an `IllegalArgumentException` if a non-String value is passed.
   - Update `BoundStatement.toProto()` to populate the `view_parameters` field in the `ExecuteQueryRequest` proto.
2. In the Java Test Proxy (`BoundStatementDeserializer.java`):
   - Update it to extract `view_parameters` from the incoming gRPC `ExecuteQueryRequest` and bind them to the `BoundStatement` before execution (naturally inheriting runtime type validation via delegation).
3. In `BoundStatementTest.java`:
   - Add unit test verifying `view_parameters` binding and proto conversion.
   - Add unit test `setViewParameterRejectsNonStringValues` verifying that passing non-String values (int64, bool, unset values, and array values) throws an `IllegalArgumentException`.
Note: `bigtable.proto` in `google-cloud-java` already includes `view_parameters` in `ExecuteQueryRequest`.

TAG=agy
CONV=11853e8d-5cf0-4c6b-8917-b8d6dbac0814

Change-Id: Ie9fb8c3c19d077a99cb3164365752ff7273cbf51
@ad548
ad548 force-pushed the feat-view-parameters branch from 93f98fc to 198cc70 Compare July 16, 2026 22:18
Change-Id: I9fd4b13273004223d84cdb4df1678a26e851d412
ad548 added 7 commits July 17, 2026 20:14
…uilder

Change-Id: I2183f39fa9b6197648c84f40eabab770096d6953
Change-Id: Ib5c71c01b359ac43e9ac68716020d6ab821ae7bd
…etStringViewParameter

Change-Id: I56289a0414f766bd66db2894e06ae24564429744
… and update deserializer

Change-Id: Iccfcdf792365a0c33cdd7383806593b31c7a5bfb
Change-Id: Ib27d1c22cf20ec7752681eab1fefbb181bbeb45e
…proxy module

Change-Id: I5b8ac33ea5ef56ea087ecaebaf58857b401f531c
…izerTest

Change-Id: Icf860414042548020a65d629862a43a601135afb
@ad548
ad548 force-pushed the feat-view-parameters branch from 1f532a5 to 0e00636 Compare July 20, 2026 20:43
…cy analyze in CI

Change-Id: I6bfc2a16b47797aed6145f785766883f4c21237b
@ad548
ad548 force-pushed the feat-view-parameters branch from 0e00636 to 2d15072 Compare July 20, 2026 20:43
Value value = entry.getValue();
switch (value.getType().getKindCase()) {
case STRING_TYPE:
if (value.getKindCase().equals(KindCase.KIND_NOT_SET)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I was following the query parameters pattern here https://github.com/ad548/google-cloud-java/blob/f051e2e08aa1306b10c5914fa90cfe34bf2e2920/java-bigtable/test-proxy/src/main/java/com/google/cloud/bigtable/testproxy/BoundStatementDeserializer.java#L50. There is two kindcase - value.getType().getKindCase() and value.getKindCase(). For view_parameters we definitely only care about the first. So yea null string with value.getType().getKindCase() string should be ok.

@mutianf
mutianf enabled auto-merge (squash) July 22, 2026 18:10
@mutianf mutianf added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 22, 2026
@mutianf
mutianf merged commit d5cc437 into googleapis:main Jul 22, 2026
209 of 212 checks passed
@ad548
ad548 deleted the feat-view-parameters branch July 22, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants