Skip to content

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

Open
ad548 wants to merge 2 commits into
googleapis:mainfrom
ad548:feat-view-parameters
Open

feat(bigtable): add view_parameters support to BoundStatement#13673
ad548 wants to merge 2 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
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.

1 participant