Skip to main content

federations

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

Overview

Namefederations
TypeResource
Idgoogle.metastore.federations

Fields

NameDatatypeDescription
namestringImmutable. The relative resource name of the federation, of the form: projects/{project_number}/locations/{location_id}/federations/{federation_id}`.
backendMetastoresobjectA map from BackendMetastore rank to BackendMetastores from which the federation service serves metadata at query time. The map key represents the order in which BackendMetastores should be evaluated to resolve database names at query time and should be greater than or equal to zero. A BackendMetastore with a lower number will be evaluated before a BackendMetastore with a higher number.
createTimestringOutput only. The time when the metastore federation was created.
endpointUristringOutput only. The federation endpoint.
labelsobjectUser-defined labels for the metastore federation.
statestringOutput only. The current state of the federation.
stateMessagestringOutput only. Additional information about the current state of the metastore federation, if available.
uidstringOutput only. The globally unique resource identifier of the metastore federation.
updateTimestringOutput only. The time when the metastore federation was last updated.
versionstringImmutable. The Apache Hive metastore version of the federation. All backend metastore versions must be compatible with the federation version.

Methods

NameAccessible byRequired ParamsDescription
getSELECTfederationsId, locationsId, projectsIdGets the details of a single federation.
listSELECTlocationsId, projectsIdLists federations in a project and location.
createINSERTlocationsId, projectsIdCreates a metastore federation in a project and location.
deleteDELETEfederationsId, locationsId, projectsIdDeletes a single federation.
patchUPDATEfederationsId, locationsId, projectsIdUpdates the fields of a federation.

SELECT examples

Lists federations in a project and location.

SELECT
name,
backendMetastores,
createTime,
endpointUri,
labels,
state,
stateMessage,
uid,
updateTime,
version
FROM google.metastore.federations
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

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

/*+ create */
INSERT INTO google.metastore.federations (
locationsId,
projectsId,
name,
labels,
version,
backendMetastores
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ name }}',
'{{ labels }}',
'{{ version }}',
'{{ backendMetastores }}'
;

UPDATE example

Updates a federations resource.

/*+ update */
UPDATE google.metastore.federations
SET
name = '{{ name }}',
labels = '{{ labels }}',
version = '{{ version }}',
backendMetastores = '{{ backendMetastores }}'
WHERE
federationsId = '{{ federationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified federations resource.

/*+ delete */
DELETE FROM google.metastore.federations
WHERE federationsId = '{{ federationsId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';