ReadRowsQuery(
row_keys: typing.Optional[typing.Union[list[str | bytes], str, bytes]] = None,
row_ranges: typing.Optional[
typing.Union[
list[google.cloud.bigtable.data.read_rows_query.RowRange],
google.cloud.bigtable.data.read_rows_query.RowRange,
]
] = None,
limit: typing.Optional[int] = None,
row_filter: typing.Optional[
google.cloud.bigtable.data.row_filters.RowFilter
] = None,
)
Class to encapsulate details of a read row request
Properties
filter
Return the RowFilter applied to this query
Returns | |
---|---|
Type | Description |
RowFilter None |
the RowFilter applied to this query |
limit
Return the maximum number of rows to return by this query
None or 0 means no limit
Returns | |
---|---|
Type | Description |
int None |
the maximum number of rows to return by this query |
row_keys
Return the row keys in this query
Returns | |
---|---|
Type | Description |
list[bytes] |
the row keys in this query |
row_ranges
Return the row ranges in this query
Returns | |
---|---|
Type | Description |
list[RowRange] |
the row ranges in this query |
Methods
__eq__
__eq__(other)
RowRanges are equal if they have the same row keys, row ranges, filter and limit, or if they both represent a full scan with the same filter and limit
Returns | |
---|---|
Type | Description |
bool |
True if the objects are equal, False otherwise |
add_key
add_key(row_key: str | bytes)
Add a row key to this query
A query can contain multiple keys, but ranges should be preferred
Exceptions | |
---|---|
Type | Description |
ValueError |
if an input is not a string or bytes |
add_range
add_range(row_range: google.cloud.bigtable.data.read_rows_query.RowRange)
Add a range of row keys to this query.
shard
shard(shard_keys: RowKeySamples) -> ShardedQuery
Split this query into multiple queries that can be evenly distributed across nodes and run in parallel
Exceptions | |
---|---|
Type | Description |
AttributeError |
if the query contains a limit |
Returns | |
---|---|
Type | Description |
ShardedQuery |
a ShardedQuery that can be used in sharded_read_rows calls |