@@ -7,8 +7,10 @@ column families, you are ready to store and retrieve data.
77Cells vs. Columns vs. Column Families
88+++++++++++++++++++++++++++++++++++++
99
10- * As we saw before, a table can have many column families.
11- * As we'll see below, a table also has many rows (specified by row keys).
10+ * As explained in the :doc: `table overview <bigtable-table-api >`, tables can
11+ have many column families.
12+ * As described below, a table can also have many rows which are
13+ specified by row keys.
1214* Within a row, data is stored in a cell. A cell simply has a value (as
1315 bytes) and a timestamp. The number of cells in each row can be
1416 different, depending on what was stored in each row.
@@ -51,7 +53,7 @@ methods.
5153* The **conditional ** way is via `CheckAndMutateRow `_. This method
5254 first checks if some filter is matched in a a given row, then
5355 applies one of two sets of mutations, depending on if a match
54- occurred or not. (These mutations sets are called the "true
56+ occurred or not. (These mutation sets are called the "true
5557 mutations" and "false mutations".)
5658* The **append ** way is via `ReadModifyWriteRow `_. This simply
5759 appends (as bytes) or increments (as an integer) data in a presumed
@@ -142,7 +144,7 @@ Direct mutations can be added via one of four methods
142144 Conditional Mutations
143145---------------------
144146
145- Making **conditional ** conditional modifications is essentially identical
147+ Making **conditional ** modifications is essentially identical
146148to **direct ** modifications, but we need to specify a filter to match
147149against in the row:
148150
@@ -157,13 +159,15 @@ The only other difference from **direct** modifications are that each mutation
157159added must specify a ``state ``: will the mutation be applied if the filter
158160matches or if it fails to match.
159161
160- For example
162+ For example:
161163
162164.. code :: python
163165
164166 row.set_cell(column_family_id, column, value,
165167 timestamp = timestamp, state = True )
166168
169+ will add to the set of true mutations.
170+
167171.. note ::
168172
169173 If ``state `` is passed when no ``filter_ `` is set on a
@@ -176,15 +180,15 @@ Append Mutations
176180
177181Append mutations can be added via one of two methods
178182
179- * :meth: `append_cell_value <gcloud.bigtable.row.Row.append_cell_value> ` appends
180- a bytes value to an existing cell:
183+ * :meth: `append_cell_value() <gcloud.bigtable.row.Row.append_cell_value> `
184+ appends a bytes value to an existing cell:
181185
182186 .. code :: python
183187
184188 row.append_cell_value(column_family_id, column, bytes_value)
185189
186- * :meth: `increment_cell_value <gcloud.bigtable.row.Row.increment_cell_value> ` increments
187- an integer value in an existing cell:
190+ * :meth: `increment_cell_value() <gcloud.bigtable.row.Row.increment_cell_value> `
191+ increments an integer value in an existing cell:
188192
189193 .. code :: python
190194
@@ -228,7 +232,33 @@ To make a `ReadRows`_ API request for a single row key, use
228232
229233.. code :: python
230234
231- row_data = table.read_row(row_key)
235+ >> > row_data = table.read_row(row_key)
236+ >> > row_data.cells
237+ {
238+ u ' fam1' : {
239+ b ' col1' : [
240+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10> ,
241+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10> ,
242+ ],
243+ b ' col2' : [
244+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10> ,
245+ ],
246+ },
247+ u ' fam2' : {
248+ b ' col3' : [
249+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10> ,
250+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10> ,
251+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10> ,
252+ ],
253+ },
254+ }
255+ >> > cell = row_data.cells[u ' fam1' ][b ' col1' ][0 ]
256+ >> > cell
257+ < gcloud.bigtable.row_data.Cell at 0x 7f80d150ef10>
258+ >> > cell.value
259+ b ' val1'
260+ >> > cell.timestamp
261+ datetime.datetime(2016 , 2 , 27 , 3 , 41 , 18 , 122823 , tzinfo = < UTC > )
232262
233263 Rather than returning a :class: `Row <gcloud.bigtable.row.Row> `, this method
234264returns a :class: `PartialRowData <gcloud.bigtable.row_data.PartialRowData> `
@@ -257,10 +287,6 @@ To make a `ReadRows`_ API request for a stream of rows, use
257287 row_data = table.read_rows()
258288
259289 Using gRPC over HTTP/2, a continual stream of responses will be delivered.
260- We have a custom
261- :class: `PartialRowsData <gcloud.bigtable.row_data.PartialRowsData> `
262- class to allow consuming and parsing these streams as they come.
263-
264290In particular
265291
266292* :meth: `consume_next() <gcloud.bigtable.row_data.PartialRowsData.consume_next> `
0 commit comments