@@ -113,6 +113,37 @@ public final class Table extends com.google.api.client.json.GenericJson {
113113 @ com .google .api .client .util .Key
114114 private RestoreInfo restoreInfo ;
115115
116+ /**
117+ * The row key schema for this table. The schema is used to decode the raw row key bytes into a
118+ * structured format. The order of field declarations in this schema is important, as it reflects
119+ * how the raw row key bytes are structured. Currently, this only affects how the key is read via
120+ * a GoogleSQL query from the ExecuteQuery API. For a SQL query, the _key column is still read as
121+ * raw bytes. But queries can reference the key fields by name, which will be decoded from _key
122+ * using provided type and encoding. Queries that reference key fields will fail if they encounter
123+ * an invalid row key. For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
124+ * following schema: { fields { field_name: "id" type { string { encoding: utf8_bytes {} } } }
125+ * fields { field_name: "date" type { string { encoding: utf8_bytes {} } } } fields { field_name:
126+ * "product_code" type { int64 { encoding: big_endian_bytes {} } } } encoding { delimited_bytes {
127+ * delimiter: "#" } } } The decoded key parts would be: id = "some_id", date = "2024-04-30",
128+ * product_code = 1245427 The query "SELECT _key, product_code FROM table" will return two
129+ * columns: /------------------------------------------------------\ | _key | product_code | |
130+ * --------------------------------------|--------------| | "some_id#2024-04-30#\x00\x13\x00\xf3"
131+ * | 1245427 | \------------------------------------------------------/ The schema has the
132+ * following invariants: (1) The decoded field values are order-preserved. For read, the field
133+ * values will be decoded in sorted mode from the raw bytes. (2) Every field in the schema must
134+ * specify a non-empty name. (3) Every field must specify a type with an associated encoding. The
135+ * type is limited to scalar types only: Array, Map, Aggregate, and Struct are not allowed. (4)
136+ * The field names must not collide with existing column family names and reserved keywords "_key"
137+ * and "_timestamp". The following update operations are allowed for row_key_schema: - Update from
138+ * an empty schema to a new schema. - Remove the existing schema. This operation requires setting
139+ * the `ignore_warnings` flag to `true`, since it might be a backward incompatible change. Without
140+ * the flag, the update request will fail with an INVALID_ARGUMENT error. Any other row key schema
141+ * update operation (e.g. update existing schema columns names or types) is currently unsupported.
142+ * The value may be {@code null}.
143+ */
144+ @ com .google .api .client .util .Key
145+ private GoogleBigtableAdminV2TypeStruct rowKeySchema ;
146+
116147 /**
117148 * Output only. Only available with STATS_VIEW, this includes summary statistics about the entire
118149 * table contents. For statistics about a specific column family, see ColumnFamilyStats in the
@@ -286,6 +317,71 @@ public Table setRestoreInfo(RestoreInfo restoreInfo) {
286317 return this ;
287318 }
288319
320+ /**
321+ * The row key schema for this table. The schema is used to decode the raw row key bytes into a
322+ * structured format. The order of field declarations in this schema is important, as it reflects
323+ * how the raw row key bytes are structured. Currently, this only affects how the key is read via
324+ * a GoogleSQL query from the ExecuteQuery API. For a SQL query, the _key column is still read as
325+ * raw bytes. But queries can reference the key fields by name, which will be decoded from _key
326+ * using provided type and encoding. Queries that reference key fields will fail if they encounter
327+ * an invalid row key. For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
328+ * following schema: { fields { field_name: "id" type { string { encoding: utf8_bytes {} } } }
329+ * fields { field_name: "date" type { string { encoding: utf8_bytes {} } } } fields { field_name:
330+ * "product_code" type { int64 { encoding: big_endian_bytes {} } } } encoding { delimited_bytes {
331+ * delimiter: "#" } } } The decoded key parts would be: id = "some_id", date = "2024-04-30",
332+ * product_code = 1245427 The query "SELECT _key, product_code FROM table" will return two
333+ * columns: /------------------------------------------------------\ | _key | product_code | |
334+ * --------------------------------------|--------------| | "some_id#2024-04-30#\x00\x13\x00\xf3"
335+ * | 1245427 | \------------------------------------------------------/ The schema has the
336+ * following invariants: (1) The decoded field values are order-preserved. For read, the field
337+ * values will be decoded in sorted mode from the raw bytes. (2) Every field in the schema must
338+ * specify a non-empty name. (3) Every field must specify a type with an associated encoding. The
339+ * type is limited to scalar types only: Array, Map, Aggregate, and Struct are not allowed. (4)
340+ * The field names must not collide with existing column family names and reserved keywords "_key"
341+ * and "_timestamp". The following update operations are allowed for row_key_schema: - Update from
342+ * an empty schema to a new schema. - Remove the existing schema. This operation requires setting
343+ * the `ignore_warnings` flag to `true`, since it might be a backward incompatible change. Without
344+ * the flag, the update request will fail with an INVALID_ARGUMENT error. Any other row key schema
345+ * update operation (e.g. update existing schema columns names or types) is currently unsupported.
346+ * @return value or {@code null} for none
347+ */
348+ public GoogleBigtableAdminV2TypeStruct getRowKeySchema () {
349+ return rowKeySchema ;
350+ }
351+
352+ /**
353+ * The row key schema for this table. The schema is used to decode the raw row key bytes into a
354+ * structured format. The order of field declarations in this schema is important, as it reflects
355+ * how the raw row key bytes are structured. Currently, this only affects how the key is read via
356+ * a GoogleSQL query from the ExecuteQuery API. For a SQL query, the _key column is still read as
357+ * raw bytes. But queries can reference the key fields by name, which will be decoded from _key
358+ * using provided type and encoding. Queries that reference key fields will fail if they encounter
359+ * an invalid row key. For example, if _key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the
360+ * following schema: { fields { field_name: "id" type { string { encoding: utf8_bytes {} } } }
361+ * fields { field_name: "date" type { string { encoding: utf8_bytes {} } } } fields { field_name:
362+ * "product_code" type { int64 { encoding: big_endian_bytes {} } } } encoding { delimited_bytes {
363+ * delimiter: "#" } } } The decoded key parts would be: id = "some_id", date = "2024-04-30",
364+ * product_code = 1245427 The query "SELECT _key, product_code FROM table" will return two
365+ * columns: /------------------------------------------------------\ | _key | product_code | |
366+ * --------------------------------------|--------------| | "some_id#2024-04-30#\x00\x13\x00\xf3"
367+ * | 1245427 | \------------------------------------------------------/ The schema has the
368+ * following invariants: (1) The decoded field values are order-preserved. For read, the field
369+ * values will be decoded in sorted mode from the raw bytes. (2) Every field in the schema must
370+ * specify a non-empty name. (3) Every field must specify a type with an associated encoding. The
371+ * type is limited to scalar types only: Array, Map, Aggregate, and Struct are not allowed. (4)
372+ * The field names must not collide with existing column family names and reserved keywords "_key"
373+ * and "_timestamp". The following update operations are allowed for row_key_schema: - Update from
374+ * an empty schema to a new schema. - Remove the existing schema. This operation requires setting
375+ * the `ignore_warnings` flag to `true`, since it might be a backward incompatible change. Without
376+ * the flag, the update request will fail with an INVALID_ARGUMENT error. Any other row key schema
377+ * update operation (e.g. update existing schema columns names or types) is currently unsupported.
378+ * @param rowKeySchema rowKeySchema or {@code null} for none
379+ */
380+ public Table setRowKeySchema (GoogleBigtableAdminV2TypeStruct rowKeySchema ) {
381+ this .rowKeySchema = rowKeySchema ;
382+ return this ;
383+ }
384+
289385 /**
290386 * Output only. Only available with STATS_VIEW, this includes summary statistics about the entire
291387 * table contents. For statistics about a specific column family, see ColumnFamilyStats in the
0 commit comments