You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I assume you want to answer the question "does row key X have any columns/values?". You can use a scanner for that, and use a filter to avoid retrieving the actual row contents (this saves network IO). Example (untested):
row_key=b'this-is-the-row-key'scan=table.scan(
row_start=row_key,
filter='KeyOnlyFilter() AND FirstKeyOnlyFilter()',
limit=1)
ifnext(scan, None) isnotNone:
pass# the row had at least one column/valueelse:
pass# the row did not exist at all
Hi,
How can I just check if a key exists or not rather than return the value of the row?
Thanks
The text was updated successfully, but these errors were encountered: