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

fix(bigtable): Allow micro seconds in filter in Bigtable emulator #9414

Merged
merged 5 commits into from
Feb 15, 2024

Conversation

bhshkh
Copy link
Contributor

@bhshkh bhshkh commented Feb 12, 2024

Issue: Bigtable emulator does not allow microseconds precision in timestamp range filter. E.g. when below code is run against emulator:

// milliseconds an hours ago
long milliTimestamp = Instant.now().minus(1, ChronoUnit.HOURS).toEpochMilli() * 1000;
.....
long microTimestamp = milliTimestamp + 345;
ConditionalRowMutation conditionalRowMutation = ConditionalRowMutation.create(tableId, rowkey)
    .condition(FILTERS.chain().filter(FILTERS.timestamp().exact(microTimestamp)))
    .then(mutation);
boolean success = dataClient.checkAndMutateRow(conditionalRowMutation);

Throws error:

com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: Error in field 'timestamp_range_filter'. Maximum precision allowed in filter is millisecond.
Got:
Start: 1707777251311345
End: 1707777251311346

The above code runs successfully when run against an actual Bigtable instance

Cause: Emulator has a validation to check whether timestamp is in milliseconds
Fix: Remove validation from emulator

Closes: #9149

@bhshkh bhshkh requested review from igorbernstein2 and a team as code owners February 12, 2024 23:38
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: bigtable Issues related to the Bigtable API. labels Feb 12, 2024
@bhshkh bhshkh enabled auto-merge (squash) February 14, 2024 20:01
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Feb 15, 2024
@bhshkh bhshkh added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Feb 15, 2024
@kokoro-team kokoro-team removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Feb 15, 2024
@bhshkh bhshkh merged commit 9fe6061 into googleapis:main Feb 15, 2024
9 of 12 checks passed
@bhshkh bhshkh deleted the fix/issue-9149 branch February 15, 2024 20:33
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 Bigtable API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bigtable: Allow microseconds for TimestampRangeFilter in emulator
4 participants