Skip to main content

tables

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

Overview

Nametables
TypeResource
Idgoogle.biglake.tables

Fields

NameDatatypeDescription
namestringOutput only. The resource name. Format: projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id}
createTimestringOutput only. The creation time of the table.
deleteTimestringOutput 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.
expireTimestringOutput only. The time when this table is considered expired. Only set after the table is deleted.
hiveOptionsobjectOptions of a Hive table.
typestringThe table type.
updateTimestringOutput only. The last modification time of the table.

Methods

NameAccessible byRequired ParamsDescription
getSELECTcatalogsId, databasesId, locationsId, projectsId, tablesIdGets the table specified by the resource name.
listSELECTcatalogsId, databasesId, locationsId, projectsIdList all tables in a specified database.
createINSERTcatalogsId, databasesId, locationsId, projectsIdCreates a new table.
deleteDELETEcatalogsId, databasesId, locationsId, projectsId, tablesIdDeletes an existing table specified by the table ID.
patchUPDATEcatalogsId, databasesId, locationsId, projectsId, tablesIdUpdates an existing table specified by the table ID.
renameEXECcatalogsId, databasesId, locationsId, projectsId, tablesIdRenames an existing table specified by the table ID.

SELECT examples

List all tables in a specified database.

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

INSERT example

Use the following StackQL query and manifest file to create a new tables resource.

/*+ create */
INSERT INTO google.biglake.tables (
catalogsId,
databasesId,
locationsId,
projectsId,
hiveOptions,
type,
etag
)
SELECT
'{{ catalogsId }}',
'{{ databasesId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ hiveOptions }}',
'{{ type }}',
'{{ etag }}'
;

UPDATE example

Updates a tables resource.

/*+ update */
UPDATE google.biglake.tables
SET
hiveOptions = '{{ hiveOptions }}',
type = '{{ type }}',
etag = '{{ etag }}'
WHERE
catalogsId = '{{ catalogsId }}'
AND databasesId = '{{ databasesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND tablesId = '{{ tablesId }}';

DELETE example

Deletes the specified tables resource.

/*+ delete */
DELETE FROM google.biglake.tables
WHERE catalogsId = '{{ catalogsId }}'
AND databasesId = '{{ databasesId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND tablesId = '{{ tablesId }}';