tables
Creates, updates, deletes, gets or lists a tables
resource.
Overview
Name | tables |
Type | Resource |
Id | google.biglake.tables |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Output only. The resource name. Format: projects/{project_id_or_number}/locations/{location_id}/catalogs/{catalog_id}/databases/{database_id}/tables/{table_id} |
createTime | string | Output only. The creation time of the table. |
deleteTime | string | Output only. The deletion time of the table. Only set after the table is deleted. |
etag | string | The 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. |
expireTime | string | Output only. The time when this table is considered expired. Only set after the table is deleted. |
hiveOptions | object | Options of a Hive table. |
type | string | The table type. |
updateTime | string | Output only. The last modification time of the table. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | catalogsId, databasesId, locationsId, projectsId, tablesId | Gets the table specified by the resource name. |
list | SELECT | catalogsId, databasesId, locationsId, projectsId | List all tables in a specified database. |
create | INSERT | catalogsId, databasesId, locationsId, projectsId | Creates a new table. |
delete | DELETE | catalogsId, databasesId, locationsId, projectsId, tablesId | Deletes an existing table specified by the table ID. |
patch | UPDATE | catalogsId, databasesId, locationsId, projectsId, tablesId | Updates an existing table specified by the table ID. |
rename | EXEC | catalogsId, databasesId, locationsId, projectsId, tablesId | Renames 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.biglake.tables (
catalogsId,
databasesId,
locationsId,
projectsId,
hiveOptions,
type,
etag
)
SELECT
'{{ catalogsId }}',
'{{ databasesId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ hiveOptions }}',
'{{ type }}',
'{{ etag }}'
;
- name: your_resource_model_name
props:
- name: hiveOptions
value:
- name: parameters
value: object
- name: tableType
value: string
- name: storageDescriptor
value:
- name: locationUri
value: string
- name: inputFormat
value: string
- name: outputFormat
value: string
- name: serdeInfo
value:
- name: serializationLib
value: string
- name: name
value: string
- name: createTime
value: string
- name: updateTime
value: string
- name: deleteTime
value: string
- name: expireTime
value: string
- name: type
value: string
- name: etag
value: string
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 }}';