Class KeySet (3.40.1)

KeySet(mapping=None,*,ignore_unknown_fields=False,**kwargs)

KeySet defines a collection of Cloud Spanner keys and/or keyranges. All the keys are expected to be in the same table or index.The keys need not be sorted in any particular way.

If the same key is specified multiple times in the set (for exampleif two ranges, two keys, or a key and a range overlap), CloudSpanner behaves as if the key were only specified once.

Attributes

NameDescription
keysMutableSequence[google.protobuf.struct_pb2.ListValue]
A list of specific keys. Entries inkeys should have exactly as many elements as there are columns in the primary or index key with which thisKeySet is used. Individual key values are encoded as describedhere][google.spanner.v1.TypeCode].
rangesMutableSequence[google.cloud.spanner_v1.types.KeyRange]
A list of key ranges. SeeKeyRange][google.spanner.v1.KeyRange] for more information about key range specifications.
all_bool
For convenienceall can be set totrue to indicate that thisKeySet matches all keys in the table or index. Note that any keys specified inkeys orranges are only yielded once.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-18 UTC.