Skip to content

google-cloud-spanner: can't easily delete all leading and trailing rows in a table #1629

@archiecobbs

Description

@archiecobbs

The Mutation API does not allow deleting a range of keys where the minimum or maximum key is "infinity".

In other words, there's no way to do the equivalent of DELETE FROM Table WHERE key > @value.

This is because the KeyRange class does not have values for positive and negative infinity.

Instead, you have to iterate over the rows and delete them one by one, unless the key's type happens to have known absolute maximum and minimum values (some do not, e.g., BYTES and String do not have maximum values).

Is this omission intentional?

If not, request adding the ability to specify "infinity" for the start and/or end of a KeyRange.

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the Spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions