Module table (3.36.0)

Define API Tables.

Classes

BigLakeConfiguration

BigLakeConfiguration(connection_id:typing.Optional[str]=None,storage_uri:typing.Optional[str]=None,file_format:typing.Optional[str]=None,table_format:typing.Optional[str]=None,_properties:typing.Optional[dict]=None,)

Configuration for managed tables for Apache Iceberg, formerly known as BigLake.

Parameters
NameDescription
connection_idOptional[str]

The connection specifying the credentials to be used to read and write to external storage, such as Cloud Storage. The connection_id can have the form{project}.{location}.{connection_id} orprojects/{project}/locations/{location}/connections/{connection_id}.

storage_uriOptional[str]

The fully qualified location prefix of the external folder where table data is stored. The '*' wildcard character is not allowed. The URI should be in the formatgs://bucket/path_to_table/.

file_formatOptional[str]

The file format the table data is stored in. See BigLakeFileFormat for available values.

table_formatOptional[str]

The table format the metadata only snapshots are stored in. See BigLakeTableFormat for available values.

_propertiesOptional[dict]

Private. Used to construct object from API resource.

CloneDefinition

CloneDefinition(resource:typing.Dict[str,typing.Any])

Information about base table and clone time of the clone.

Seehttps://cloud.google.com/bigquery/docs/reference/rest/v2/tables#clonedefinition

ColumnReference

ColumnReference(referencing_column:str,referenced_column:str)

The pair of the foreign key column and primary key column.

ForeignKey

ForeignKey(name:str,referenced_table:google.cloud.bigquery.table.TableReference,column_references:typing.List[google.cloud.bigquery.table.ColumnReference],)

Represents a foreign key constraint on a table's columns.

PartitionRange

PartitionRange(start=None,end=None,interval=None,_properties=None)
Parameters
NameDescription
startOptional[int]

Sets thestart property.

endOptional[int]

Sets theend property.

intervalOptional[int]

Sets theinterval property.

_propertiesOptional[dict]

Private. Used to construct object from API resource.

PrimaryKey

PrimaryKey(columns:typing.List[str])

Represents the primary key constraint on a table's columns.

RangePartitioning

RangePartitioning(range_=None,field=None,_properties=None)
Parameters
NameDescription
range_Optional[google.cloud.bigquery.table.PartitionRange]

Sets therange_ property.

fieldOptional[str]

Sets thefield property.

_propertiesOptional[dict]

Private. Used to construct object from API resource.

Row

Row(values,field_to_index)

A BigQuery row.

Values can be accessed by position (index), by key like a dict,or as properties.

Parameters
NameDescription
valuesSequence[object]

The row values

field_to_indexDict[str, int]

A mapping from schema field names to indexes

RowIterator

RowIterator(client,api_request,path,schema,page_token=None,max_results=None,page_size=None,extra_params=None,table=None,selected_fields=None,total_rows=None,first_page_response=None,location:typing.Optional[str]=None,job_id:typing.Optional[str]=None,query_id:typing.Optional[str]=None,project:typing.Optional[str]=None,num_dml_affected_rows:typing.Optional[int]=None,query:typing.Optional[str]=None,total_bytes_processed:typing.Optional[int]=None,slot_millis:typing.Optional[int]=None,created:typing.Optional[datetime.datetime]=None,started:typing.Optional[datetime.datetime]=None,ended:typing.Optional[datetime.datetime]=None,)

A class for iterating through HTTP/JSON API row list responses.

Parameters
NameDescription
queryOptional[str]

The query text used.

total_bytes_processedOptional[int]

If representing query results, the total bytes processed by the associated query.

slot_millisOptional[int]

If representing query results, the number of slot ms billed for the associated query.

createdOptional[datetime.datetime]

If representing query results, the creation time of the associated query.

startedOptional[datetime.datetime]

If representing query results, the start time of the associated query.

endedOptional[datetime.datetime]

If representing query results, the end time of the associated query.

clientOptional[google.cloud.bigquery.Client]

The API client instance. This should always be non-None, except for subclasses that do not use it, namely the_EmptyRowIterator.

api_requestCallable[google.cloud._http.JSONConnection.api_request]

The function to use to make API requests.

pathstr

The method path to query for the list of items.

schemaSequence[Union[SchemaField, Mapping[str, Any] ]]

The table's schema. If any item is a mapping, its content must be compatible withfrom_api_repr.

page_tokenstr

A token identifying a page in a result set to start fetching results from.

max_resultsOptional[int]

The maximum number of results to fetch.

page_sizeOptional[int]

The maximum number of rows in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by the API.

extra_paramsOptional[Dict[str, object]]

Extra query string parameters for the API call.

tableOptional[Union[google.cloud.bigquery.table.Table,google.cloud.bigquery.table.TableReference, ]]

The table which these rows belong to, or a reference to it. Used to call the BigQuery Storage API to fetch rows.

selected_fieldsOptional[Sequence[google.cloud.bigquery.schema.SchemaField]]

A subset of columns to select from this table.

total_rowsOptional[int]

Total number of rows in the table.

first_page_responseOptional[dict]

API response for the first page of results. These are returned when the first page is requested.

SnapshotDefinition

SnapshotDefinition(resource:typing.Dict[str,typing.Any])

Information about base table and snapshot time of the snapshot.

Seehttps://cloud.google.com/bigquery/docs/reference/rest/v2/tables#snapshotdefinition

StreamingBuffer

StreamingBuffer(resource)

Information about a table's streaming buffer.

Seehttps://cloud.google.com/bigquery/streaming-data-into-bigquery.

Parameter
NameDescription
resourceDict[str, object]

streaming buffer representation returned from the API

Table

Table(table_ref,schema=None)

Tables represent a set of rows whose values correspond to a schema.

Seehttps://cloud.google.com/bigquery/docs/reference/rest/v2/tables#resource-table

Parameters
NameDescription
table_refUnion[google.cloud.bigquery.table.TableReference, str]

A pointer to a table. Iftable_ref is a string, it must included a project ID, dataset ID, and table ID, each separated by..

schemaOptional[Sequence[Union[SchemaField, Mapping[str, Any] ]]]

The table's schema. If any item is a mapping, its content must be compatible withfrom_api_repr.

TableConstraints

TableConstraints(primary_key:typing.Optional[google.cloud.bigquery.table.PrimaryKey],foreign_keys:typing.Optional[typing.List[google.cloud.bigquery.table.ForeignKey]],)

The TableConstraints defines the primary key and foreign key.

TableListItem

TableListItem(resource)

A read-only table resource from a list operation.

For performance reasons, the BigQuery API only includes some of the tableproperties when listing tables. Notably,xref_schema andxref_num_rows are missing.

For a full list of the properties that the BigQuery API returns, see theREST documentation for tables.list<https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/list>_.

Parameter
NameDescription
resourceDict[str, object]

A table-like resource object from a table list response. AtableReference property is required.

Exceptions
TypeDescription
ValueErrorIftableReference or one of its required members is missing fromresource.

TableReference

TableReference(dataset_ref:DatasetReference,table_id:str)

TimePartitioning

TimePartitioning(type_=None,field=None,expiration_ms=None,require_partition_filter=None)

Configures time-based partitioning for a table.

Parameters
NameDescription
type_Optional[google.cloud.bigquery.table.TimePartitioningType]

Specifies the type of time partitioning to perform. Defaults toDAY. Supported values are: *HOUR *DAY *MONTH *YEAR

fieldOptional[str]

If set, the table is partitioned by this field. If not set, the table is partitioned by pseudo columnPARTITIONTIME. The field must be a top-levelTIMESTAMP,DATETIME, orDATE field. Its mode must beNULLABLE orREQUIRED. See thetime-unit column-partitioned tables guidehttps://cloud.google.com/bigquery/docs/creating-column-partitions in the BigQuery documentation.

expiration_msOptional[int]

Number of milliseconds for which to keep the storage for a partition.

require_partition_filterOptional[bool]

DEPRECATED: Userequire_partition_filter, instead.

TimePartitioningType

TimePartitioningType()

Specifies the type of time partitioning to perform.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-16 UTC.