Atomic counter provides real-time statistics for online applications, such as the real-time page views (PVs) of a post.

  • For more information about atomic counters, see Atomic counters.
  • Atomic counter is applicable to SDK 5.1.0 and later.


The following code provides an example on how to use the update_row operation to update the columns whose valid values are integers when writing a row of data. The INCREMENT parameter is set.
def increment_by_update_row(client):
    primary_key = [('pk0', 1)]
    # Specify to increment the values of the price attribute by 6.
    update_of_attribute_columns = {
        'INCREMENT': [('price', 6)]
    row = Row(primary_key, update_of_attribute_columns)
    consumed, return_row = client.update_row(table_name, row, None)
    print ('Update succeed, consume %s write cu.' % consumed.write)