Resource: Table
A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its parent cluster.
JSON representation |
---|
{ "name": string, "clusterStates": { string: { object ( |
Fields | |
---|---|
name |
The unique name of the table. Values are of the form |
cluster |
Output only. Map from cluster ID to per-cluster table state. If it could not be determined whether or not the table has data in a particular cluster (for example, if its zone is unavailable), then there will be an entry for the cluster with UNKNOWN An object containing a list of |
column |
The column families configured for this table, mapped by column family ID. Views: An object containing a list of |
granularity |
Immutable. The granularity (i.e. |
restore |
Output only. If this table was restored from another data source (e.g. a backup), this field will be populated with information about the restore. |
change |
If specified, enable the change stream on this table. Otherwise, the change stream is disabled and the change stream is not retained. |
deletion |
Set to true to make the table protected against data loss. i.e. deleting the following resources through Admin APIs are prohibited:
Note one can still delete the data stored in the table through Data APIs. |
stats |
Output only. Only available with STATS_VIEW, this includes summary statistics about the entire table contents. For statistics about a specific column family, see ColumnFamilyStats in the mapped ColumnFamily collection above. |
Union field
|
|
automated |
If specified, automated backups are enabled for this table. Otherwise, automated backups are disabled. |
ClusterState
The state of a table's data in a particular cluster.
JSON representation |
---|
{ "replicationState": enum ( |
Fields | |
---|---|
replication |
Output only. The state of replication for the table in this cluster. |
encryption |
Output only. The encryption information for the table in this cluster. If the encryption key protecting this resource is customer managed, then its version can be rotated in Cloud Key Management Service (Cloud KMS). The primary version of the key and its status will be reflected here when changes propagate from Cloud KMS. |
ReplicationState
Table replication states.
Enums | |
---|---|
STATE_NOT_KNOWN |
The replication state of the table is unknown in this cluster. |
INITIALIZING |
The cluster was recently created, and the table must finish copying over pre-existing data from other clusters before it can begin receiving live replication updates and serving Data API requests. |
PLANNED_MAINTENANCE |
The table is temporarily unable to serve Data API requests from this cluster due to planned internal maintenance. |
UNPLANNED_MAINTENANCE |
The table is temporarily unable to serve Data API requests from this cluster due to unplanned or emergency maintenance. |
READY |
The table can serve Data API requests from this cluster. Depending on replication delay, reads may not immediately reflect the state of the table in other clusters. |
READY_OPTIMIZING |
The table is fully created and ready for use after a restore, and is being optimized for performance. When optimizations are complete, the table will transition to READY state. |
ColumnFamily
A set of columns within a table which share a common configuration.
JSON representation |
---|
{ "gcRule": { object ( |
Fields | |
---|---|
gc |
Garbage collection rule specified as a protobuf. Must serialize to at most 500 bytes. NOTE: Garbage collection executes opportunistically in the background, and so it's possible for reads to return a cell even if it matches the active GC expression for its family. |
stats |
Output only. Only available with STATS_VIEW, this includes summary statistics about column family contents. For statistics over an entire table, see TableStats above. |
value |
The type of data stored in each of this family's cell values, including its full encoding. If omitted, the family only serves raw untyped bytes. For now, only the
If |
GcRule
Rule for determining which cells to delete during garbage collection.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field rule . Garbage collection rules. rule can be only one of the following: |
|
max |
Delete all cells in a column except the most recent N. |
max |
Delete cells in a column older than the given age. Values must be at least one millisecond, and will be truncated to microsecond granularity. A duration in seconds with up to nine fractional digits, ending with ' |
intersection |
Delete cells that would be deleted by every nested rule. |
union |
Delete cells that would be deleted by any nested rule. |
Intersection
A GcRule which deletes cells matching all of the given rules.
JSON representation |
---|
{
"rules": [
{
object ( |
Fields | |
---|---|
rules[] |
Only delete cells which would be deleted by every element of |
Union
A GcRule which deletes cells matching any of the given rules.
JSON representation |
---|
{
"rules": [
{
object ( |
Fields | |
---|---|
rules[] |
Delete cells which would be deleted by any element of |
ColumnFamilyStats
Approximate statistics related to a single column family within a table. This information may change rapidly, interpreting these values at a point in time may already preset out-of-date information.
Everything below is approximate, unless otherwise specified.
JSON representation |
---|
{ "averageColumnsPerRow": number, "averageCellsPerColumn": number, "logicalDataBytes": string } |
Fields | |
---|---|
average |
How many column qualifiers are present in this column family, averaged over all rows in the table. e.g. For column family "family" in a table with 3 rows:
would report (1 + 2 + 0)/3 = 1.5 in this field. |
average |
How many cells are present per column qualifier in this column family, averaged over all rows containing any column in the column family. e.g. For column family "family" in a table with 3 rows:
would report (3 + 8 + 0)/(1 + 2 + 0) = 3.66 in this field. |
logical |
How much space the data in the column family occupies. This is roughly how many bytes would be needed to read the contents of the entire column family (e.g. by streaming all contents out). |
Type
Type
represents the type of data that is written to, read from, or stored in Bigtable. It is heavily based on the GoogleSQL standard to help maintain familiarity and consistency across products and features.
For compatibility with Bigtable's existing untyped APIs, each Type
includes an Encoding
which describes how to convert to or from the underlying data.
Each encoding can operate in one of two modes:
- Sorted: In this mode, Bigtable guarantees that
Encode(X) <= Encode(Y)
if and only ifX <= Y
. This is useful anywhere sort order is important, for example when encoding keys. - Distinct: In this mode, Bigtable guarantees that if
X != Y
thenEncode(X) != Encode(Y)
. However, the converse is not guaranteed. For example, both "{'foo': '1', 'bar': '2'}" and "{'bar': '2', 'foo': '1'}" are valid encodings of the same JSON value.
The API clearly documents which mode is used wherever an encoding can be configured. Each encoding also documents which values are supported in which modes. For example, when encoding INT64 as a numeric STRING, negative numbers cannot be encoded in sorted mode. This is because INT64(1) > INT64(-1)
, but STRING("-00001") > STRING("00001")
.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field kind . The kind of type that this represents. kind can be only one of the following: |
|
bytes |
Bytes |
string |
String |
int64 |
Int64 |
float32 |
Float32 |
float64 |
Float64 |
bool |
Bool |
timestamp |
Timestamp |
date |
Date |
aggregate |
Aggregate |
struct |
Struct |
array |
Array |
map |
Map |
Bytes
Bytes Values of type Bytes
are stored in Value.bytes_value
.
JSON representation |
---|
{
"encoding": {
object ( |
Fields | |
---|---|
encoding |
The encoding to use when converting to or from lower level types. |
Encoding
Rules used to convert to or from lower level types.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field encoding . Which encoding to use. encoding can be only one of the following: |
|
raw |
Use |
Raw
This type has no fields.
Leaves the value as-is.
Sorted mode: all values are supported.
Distinct mode: all values are supported.
String
String Values of type String
are stored in Value.string_value
.
JSON representation |
---|
{
"encoding": {
object ( |
Fields | |
---|---|
encoding |
The encoding to use when converting to or from lower level types. |
Encoding
Rules used to convert to or from lower level types.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field encoding . Which encoding to use. encoding can be only one of the following: |
|
utf8Raw |
Deprecated: if set, converts to an empty |
utf8 |
Use |
Utf8Raw
This type has no fields.
Deprecated: prefer the equivalent Utf8Bytes
.
Utf8Bytes
This type has no fields.
UTF-8 encoding.
Sorted mode: - All values are supported. - Code point order is preserved.
Distinct mode: all values are supported.
Compatible with:
- BigQuery
TEXT
encoding - HBase
Bytes.toBytes
- Java
String#getBytes(StandardCharsets.UTF_8)
Int64
Int64 Values of type Int64
are stored in Value.int_value
.
JSON representation |
---|
{
"encoding": {
object ( |
Fields | |
---|---|
encoding |
The encoding to use when converting to or from lower level types. |
Encoding
Rules used to convert to or from lower level types.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field encoding . Which encoding to use. encoding can be only one of the following: |
|
big |
Use |
BigEndianBytes
Encodes the value as an 8-byte big-endian two's complement value.
Sorted mode: non-negative values are supported.
Distinct mode: all values are supported.
Compatible with:
- BigQuery
BINARY
encoding - HBase
Bytes.toBytes
- Java
ByteBuffer.putLong()
withByteOrder.BIG_ENDIAN
JSON representation |
---|
{
"bytesType": {
object ( |
Fields | |
---|---|
bytesType |
Deprecated: ignored if set. |
Float32
This type has no fields.
Float32 Values of type Float32
are stored in Value.float_value
.
Float64
This type has no fields.
Float64 Values of type Float64
are stored in Value.float_value
.
Bool
This type has no fields.
bool Values of type Bool
are stored in Value.bool_value
.
Timestamp
This type has no fields.
Timestamp Values of type Timestamp
are stored in Value.timestamp_value
.
Date
This type has no fields.
Date Values of type Date
are stored in Value.date_value
.
Aggregate
A value that combines incremental updates into a summarized value.
Data is never directly written or read using type Aggregate
. Writes provide either the inputType
or stateType
, and reads always return the stateType
.
JSON representation |
---|
{ "inputType": { object ( |
Fields | |
---|---|
input |
Type of the inputs that are accumulated by this |
state |
Output only. Type that holds the internal accumulator state for the |
Union field aggregator . Which aggregator function to use. The configured types must match. aggregator can be only one of the following: |
|
sum |
Sum aggregator. |
hllpp |
HyperLogLogPlusPlusUniqueCount aggregator. |
max |
Max aggregator. |
min |
Min aggregator. |
Sum
This type has no fields.
Computes the sum of the input values. Allowed input: Int64
State: same as input
HyperLogLogPlusPlusUniqueCount
This type has no fields.
Computes an approximate unique count over the input values. When using raw data as input, be careful to use a consistent encoding. Otherwise the same value encoded differently could count more than once, or two distinct values could count as identical. Input: Any, or omit for Raw State: TBD Special state conversions: Int64
(the unique count estimate)
Max
This type has no fields.
Computes the max of the input values. Allowed input: Int64
State: same as input
Min
This type has no fields.
Computes the min of the input values. Allowed input: Int64
State: same as input
Struct
A structured data value, consisting of fields which map to dynamically typed values. Values of type Struct
are stored in Value.array_value
where entries are in the same order and number as field_types
.
JSON representation |
---|
{
"fields": [
{
object ( |
Fields | |
---|---|
fields[] |
The names and types of the fields in this struct. |
Field
A struct field and its type.
JSON representation |
---|
{
"fieldName": string,
"type": {
object ( |
Fields | |
---|---|
field |
The field name (optional). Fields without a |
type |
The type of values in this field. |
Array
An ordered list of elements of a given type. Values of type Array
are stored in Value.array_value
.
JSON representation |
---|
{
"elementType": {
object ( |
Fields | |
---|---|
element |
The type of the elements in the array. This must not be |
Map
A mapping of keys to values of a given type. Values of type Map
are stored in a Value.array_value
where each entry is another Value.array_value
with two elements (the key and the value, in that order). Normally encoded Map values won't have repeated keys, however, clients are expected to handle the case in which they do. If the same key appears multiple times, the last value takes precedence.
JSON representation |
---|
{ "keyType": { object ( |
Fields | |
---|---|
key |
The type of a map key. Only |
value |
The type of the values in a map. |
TimestampGranularity
Possible timestamp granularities to use when keeping multiple versions of data in a table.
Enums | |
---|---|
TIMESTAMP_GRANULARITY_UNSPECIFIED |
The user did not specify a granularity. Should not be returned. When specified during table creation, MILLIS will be used. |
MILLIS |
The table keeps data versioned at a granularity of 1ms. |
RestoreInfo
Information about a table restore.
JSON representation |
---|
{ "sourceType": enum ( |
Fields | |
---|---|
source |
The type of the restore source. |
Union field source_info . Information about the source used to restore the table. source_info can be only one of the following: |
|
backup |
Information about the backup used to restore the table. The backup may no longer exist. |
RestoreSourceType
Indicates the type of the restore source.
Enums | |
---|---|
RESTORE_SOURCE_TYPE_UNSPECIFIED |
No restore associated. |
BACKUP |
A backup was used as the source of the restore. |
BackupInfo
Information about a backup.
JSON representation |
---|
{ "backup": string, "startTime": string, "endTime": string, "sourceTable": string, "sourceBackup": string } |
Fields | |
---|---|
backup |
Output only. Name of the backup. |
start |
Output only. The time that the backup was started. row data in the backup will be no older than this timestamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
end |
Output only. This time that the backup was finished. row data in the backup will be no newer than this timestamp. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
source |
Output only. Name of the table the backup was created from. |
source |
Output only. Name of the backup from which this backup was copied. If a backup is not created by copying a backup, this field will be empty. Values are of the form: projects/ |
ChangeStreamConfig
Change stream configuration.
JSON representation |
---|
{ "retentionPeriod": string } |
Fields | |
---|---|
retention |
How long the change stream should be retained. Change stream data older than the retention period will not be returned when reading the change stream from the table. Values must be at least 1 day and at most 7 days, and will be truncated to microsecond granularity. A duration in seconds with up to nine fractional digits, ending with ' |
TableStats
Approximate statistics related to a table.
These statistics are calculated infrequently, while simultaneously, data in the table can change rapidly. Thus the values reported here (e.g. row count) are very likely out-of date, even the instant they are received in this API. Thus, only treat these values as approximate.
IMPORTANT: Everything below is approximate, unless otherwise specified.
JSON representation |
---|
{ "rowCount": string, "averageColumnsPerRow": number, "averageCellsPerColumn": number, "logicalDataBytes": string } |
Fields | |
---|---|
row |
How many rows are in the table. |
average |
How many (column family, column qualifier) combinations are present per row in the table, averaged over all rows in the table. e.g. A table with 2 rows:
would report (2 + 3)/2 = 2.5 in this field. |
average |
How many cells are present per column (column family, column qualifier) combinations, averaged over all columns in all rows in the table. e.g. A table with 2 rows:
would report (4 + 15)/(2 + 3) = 3.8 in this field. |
logical |
This is roughly how many bytes would be needed to read the entire table (e.g. by streaming all contents out). |
AutomatedBackupPolicy
Defines an automated backup policy for a table
JSON representation |
---|
{ "retentionPeriod": string, "frequency": string } |
Fields | |
---|---|
retention |
Required. How long the automated backups should be retained. Values must be at least 3 days and at most 90 days. A duration in seconds with up to nine fractional digits, ending with ' |
frequency |
How frequently automated backups should occur. The only supported value at this time is 24 hours. An undefined frequency is treated as 24 hours. A duration in seconds with up to nine fractional digits, ending with ' |
Methods |
|
---|---|
|
Checks replication consistency based on a consistency token, that is, if replication has caught up based on the conditions specified in the token and the check request. |
|
Creates a new table in the specified instance. |
|
Permanently deletes a specified table and all of its data. |
|
Permanently drop/delete a row range from a specified table. |
|
Generates a consistency token for a Table, which can be used in CheckConsistency to check whether mutations to the table that finished before this call started have been replicated. |
|
Gets metadata information about the specified table. |
|
Gets the access control policy for a Bigtable resource. |
|
Lists all tables served from a specified instance. |
|
Performs a series of column family modifications on the specified table. |
|
Updates a specified table. |
|
Create a new table by restoring from a completed backup. |
|
Sets the access control policy on a Bigtable resource. |
|
Returns permissions that the caller has on the specified Bigtable resource. |
|
Restores a specified table which was accidentally deleted. |