Skip to content

bigtable set_cell? #2517

@dmitry-saritasa

Description

@dmitry-saritasa

I'm little confused with the purpose of set_cell method. Here is what I see in official doc:
https://cloud.google.com/bigtable/docs/samples-python-hello

for i, value in enumerate(greetings):
        row_key = 'greeting{}'.format(i)
        row = table.row(row_key)
        row.set_cell(
            column_family_id,
            column_id,
            value.encode('utf-8'))
        row.commit()

My question is if I have multiple columns to write (under column family stat), like:
user, game, spot, asset then I need to perform multiple set_cell calls before making row.commit()?

Something like this

row_key = '{}'.format(guid)
row = table.row(row_key)
row.set_cell('stat', 'user', user)
row.set_cell('stat', 'game', game)
row.set_cell('stat', 'spot', spot)
row.set_cell('stat', 'asset', asset)
row.commit()

am I correct?

also do we have an ability to batch insert many rows or they should be done one by one sequentially?

Metadata

Metadata

Labels

api: bigtableIssues related to the Bigtable API.priority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions