Skip to main content

tables

Creates, updates, deletes, gets or lists a tables resource.

Overview

Nametables
TypeResource
Idgoogle.biglake.tables

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The resource name. Format: projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
createTimestring (google-datetime)Output only. The creation time of the table.
deleteTimestring (google-datetime)Output only. The deletion time of the table. Only set after the table is deleted.
etagstringThe checksum of a table object computed by the server based on the value of other fields. It may be sent on update requests to ensure the client has an up-to-date value before proceeding. It is only checked for update table operations.
expireTimestring (google-datetime)Output only. The time when this table is considered expired. Only set after the table is deleted.
hiveOptionsobjectOptions of a Hive table. (id: HiveTableOptions)
typestringThe table type.
updateTimestring (google-datetime)Output only. The last modification time of the table.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, catalogsId, databasesId, tablesIdGets the table specified by the resource name.
listselectprojectsId, locationsId, catalogsId, databasesIdpageSize, pageToken, viewList all tables in a specified database.
createinsertprojectsId, locationsId, catalogsId, databasesIdtableIdCreates a new table.
patchupdateprojectsId, locationsId, catalogsId, databasesId, tablesIdupdateMaskUpdates an existing table specified by the table ID.
deletedeleteprojectsId, locationsId, catalogsId, databasesId, tablesIdDeletes an existing table specified by the table ID.
renameexecprojectsId, locationsId, catalogsId, databasesId, tablesIdRenames an existing table specified by the table ID.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
catalogsIdstring
databasesIdstring
locationsIdstring
projectsIdstring
tablesIdstring
pageSizeinteger (int32)
pageTokenstring
tableIdstring
updateMaskstring (google-fieldmask)
viewstring

SELECT examples

Gets the table specified by the resource name.

SELECT
name,
createTime,
deleteTime,
etag,
expireTime,
hiveOptions,
type,
updateTime
FROM google.biglake.tables
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND catalogsId = '{{ catalogsId }}' -- required
AND databasesId = '{{ databasesId }}' -- required
AND tablesId = '{{ tablesId }}' -- required;

INSERT examples

Creates a new table.

INSERT INTO google.biglake.tables (
data__hiveOptions,
data__type,
data__etag,
projectsId,
locationsId,
catalogsId,
databasesId,
tableId
)
SELECT
'{{ hiveOptions }}',
'{{ type }}',
'{{ etag }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ catalogsId }}',
'{{ databasesId }}',
'{{ tableId }}'
RETURNING
name,
createTime,
deleteTime,
etag,
expireTime,
hiveOptions,
type,
updateTime
;

UPDATE examples

Updates an existing table specified by the table ID.

UPDATE google.biglake.tables
SET
data__hiveOptions = '{{ hiveOptions }}',
data__type = '{{ type }}',
data__etag = '{{ etag }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND tablesId = '{{ tablesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
createTime,
deleteTime,
etag,
expireTime,
hiveOptions,
type,
updateTime;

DELETE examples

Deletes an existing table specified by the table ID.

DELETE FROM google.biglake.tables
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND catalogsId = '{{ catalogsId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND tablesId = '{{ tablesId }}' --required;

Lifecycle Methods

Renames an existing table specified by the table ID.

EXEC google.biglake.tables.rename 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@catalogsId='{{ catalogsId }}' --required,
@databasesId='{{ databasesId }}' --required,
@tablesId='{{ tablesId }}' --required
@@json=
'{
"newName": "{{ newName }}"
}';