Skip to content

feat: add value_bitmask_filter to the read API#16884

Closed
mutianf wants to merge 3 commits intogoogleapis:mainfrom
mutianf:bigtable-proto
Closed

feat: add value_bitmask_filter to the read API#16884
mutianf wants to merge 3 commits intogoogleapis:mainfrom
mutianf:bigtable-proto

Conversation

@mutianf
Copy link
Copy Markdown
Contributor

@mutianf mutianf commented Apr 30, 2026

Manually generate the bitmask filter proto to unblock critical proto generation.

@mutianf mutianf requested a review from a team as a code owner April 30, 2026 02:23
Copy link
Copy Markdown
Contributor

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

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 introduces the ValueBitmask feature to the Google Cloud Bigtable V2 client, adding the ValueBitmask message type and integrating it into row filters. The PR also includes extensive refactoring, such as import reordering and whitespace adjustments. Feedback was provided to separate these non-critical refactorings into a dedicated pull request to maintain focus and improve the review process.

I am having trouble creating individual review comments. Click here to see my feedback.

packages/google-cloud-bigtable/google/cloud/bigtable_v2/init.py (19)

medium

This pull request includes extensive non-critical refactoring, such as import reordering and whitespace adjustments. Please move these changes to a separate pull request to keep this one focused on the value_bitmask_filter feature and to simplify the review process.

References
  1. Defer non-critical refactoring or cleanup tasks to a separate pull request to maintain the focus and reviewability of the current one.

@parthea parthea self-assigned this Apr 30, 2026
parthea added a commit that referenced this pull request Apr 30, 2026
This PR was created outside of librarian due to b/501132869. b/501132869
should be resolved soon. In the meantime, we need to publish
`value_bitmask_filter` to avoid blocking other teams.

Steps used to create this PR

- Clone
[googleapis/googleapis](https://github.com/googleapis/googleapis) and
checkout the last generated commit
`a6cbf809c4c165e618ee23a059442af90a80a0f5` which matches what we have in
.librarian/state.yaml


https://github.com/googleapis/google-cloud-python/blob/8fa0f81cb35f93210ffb2020a8bc822a9eee5ec4/.librarian/state.yaml#L1169

- Apply this diff

```
(py392) partheniou@partheniou-vm-3:~/git/googleapis$ git diff
diff --git a/google/bigtable/v2/data.proto b/google/bigtable/v2/data.proto
index 8320a0c22f..af354b05a2 100644
--- a/google/bigtable/v2/data.proto
+++ b/google/bigtable/v2/data.proto
@@ -255,6 +255,15 @@ message ValueRange {
   }
 }
 
+// Restricts the output to cells whose values match the given bitmask.
+message ValueBitmask {
+  // Required. Mask applied to the value.
+  // Evaluated as: `(value & mask) == mask`
+  // The mask length must exactly match the value length, otherwise the cell is
+  // not considered a match.
+  bytes mask = 1 [(google.api.field_behavior) = REQUIRED];
+}
+
 // Takes a row as input and produces an alternate view of the row based on
 // specified rules. For example, a RowFilter might trim down a row to include
 // just the cells from columns matching a given regular expression, or might
@@ -514,6 +523,12 @@ message RowFilter {
     // will be applied to separate copies of the input. This may be relaxed in
     // the future.
     string apply_label_transformer = 19;
+
+    // Matches only cells with values that satisfy the condition `(value & mask)
+    // == mask`.
+    // The mask length must exactly match the value length, otherwise the cell
+    // is not considered a match.
+    ValueBitmask value_bitmask_filter = 20;
   }
 }
```

- Clone this repo. Checkout commit
`6cb5af5227e09e99ee12bb3542374f683b75d4b4` which is the last commit
where generation was run:

https://github.com/googleapis/google-cloud-python/commits/main/packages/google-cloud-bigtable

- Run `legacylibrarian generate
--api-source=<path/to/clone/of/googleapis>
--library=google-cloud-bigtable` to regenerate the library using the
local version of googleapis

- Revert changes to `.librarian/state.yaml`

Closes #16884
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.

2 participants