Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idaws.glue.schemas

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
compatibilitystringThe compatibility mode of the schema. (NONE, DISABLED, BACKWARD, BACKWARD_ALL, FORWARD, FORWARD_ALL, FULL, FULL_ALL)
created_timestringThe date and time the schema was created.
data_formatstringThe data format of the schema definition. Currently AVRO, JSON and PROTOBUF are supported. (AVRO, JSON, PROTOBUF)
descriptionstringA description of schema if specified when created (pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*</code>)
latest_schema_versioninteger (int64)The latest version of the schema associated with the returned schema definition.
next_schema_versioninteger (int64)The next version of the schema associated with the returned schema definition.
registry_arnstringThe Amazon Resource Name (ARN) of the registry. (pattern: <code>arn:aws(-(cn|us-gov|iso(-[bef])?))?:glue:.*</code>)
registry_namestringThe name of the registry. (pattern: <code>[a-zA-Z0-9-_$#.]+</code>)
schema_arnstringThe Amazon Resource Name (ARN) of the schema. (pattern: <code>arn:aws(-(cn|us-gov|iso(-[bef])?))?:glue:.*</code>)
schema_checkpointinteger (int64)The version number of the checkpoint (the last time the compatibility mode was changed).
schema_namestringThe name of the schema. (pattern: <code>[a-zA-Z0-9-_$#.]+</code>)
schema_statusstringThe status of the schema. (AVAILABLE, PENDING, DELETING)
updated_timestringThe date and time the schema was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_schemaselectregionDescribes the specified schema in detail.
list_schemasselectregionReturns a list of schemas with minimal details. Schemas in Deleting status will not be included in the results. Empty results will be returned if there are no schemas available. When the RegistryId is not provided, all the schemas across registries will be part of the API response.
create_schemainsertregion, SchemaName, DataFormatCreates a new schema set and registers the schema definition. Returns an error if the schema set already exists without actually registering the version. When the schema set is created, a version checkpoint will be set to the first version. Compatibility mode "DISABLED" restricts any additional schema versions from being added after the first schema version. For all other compatibility modes, validation of compatibility settings will be applied only from the second version onwards when the RegisterSchemaVersion API is used. When this API is called without a RegistryId, this will create an entry for a "default-registry" in the registry database tables, if it is not already present.
update_schemaupdateregion, SchemaIdUpdates the description, compatibility setting, or version checkpoint for a schema set. For updating the compatibility setting, the call will not validate compatibility for the entire set of schema versions with the new compatibility setting. If the value for Compatibility is provided, the VersionNumber (a checkpoint) is also required. The API will validate the checkpoint version number for consistency. If the value for the VersionNumber (checkpoint) is provided, Compatibility is optional and this can be used to set/reset a checkpoint for the schema. This update will happen only if the schema is in the AVAILABLE state.
delete_schemadeleteregionDeletes the entire schema set, including the schema set and all of its versions. To get the status of the delete operation, you can call GetSchema API after the asynchronous call. Deleting a registry will deactivate all online operations for the schema, such as the GetSchemaByDefinition, and RegisterSchemaVersion APIs.

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
regionstringAWS region (default: us-east-1)

SELECT examples

Describes the specified schema in detail.

SELECT
compatibility,
created_time,
data_format,
description,
latest_schema_version,
next_schema_version,
registry_arn,
registry_name,
schema_arn,
schema_checkpoint,
schema_name,
schema_status,
updated_time
FROM aws.glue.schemas
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new schema set and registers the schema definition. Returns an error if the schema set already exists without actually registering the version. When the schema set is created, a version checkpoint will be set to the first version. Compatibility mode "DISABLED" restricts any additional schema versions from being added after the first schema version. For all other compatibility modes, validation of compatibility settings will be applied only from the second version onwards when the RegisterSchemaVersion API is used. When this API is called without a RegistryId, this will create an entry for a "default-registry" in the registry database tables, if it is not already present.

INSERT INTO aws.glue.schemas (
RegistryId,
SchemaName,
DataFormat,
Compatibility,
Description,
Tags,
SchemaDefinition,
region
)
SELECT
'{{ RegistryId }}',
'{{ SchemaName }}' /* required */,
'{{ DataFormat }}' /* required */,
'{{ Compatibility }}',
'{{ Description }}',
'{{ Tags }}',
'{{ SchemaDefinition }}',
'{{ region }}'
RETURNING
compatibility,
data_format,
description,
latest_schema_version,
next_schema_version,
registry_arn,
registry_name,
schema_arn,
schema_checkpoint,
schema_name,
schema_status,
schema_version_id,
schema_version_status,
tags
;

UPDATE examples

Updates the description, compatibility setting, or version checkpoint for a schema set. For updating the compatibility setting, the call will not validate compatibility for the entire set of schema versions with the new compatibility setting. If the value for Compatibility is provided, the VersionNumber (a checkpoint) is also required. The API will validate the checkpoint version number for consistency. If the value for the VersionNumber (checkpoint) is provided, Compatibility is optional and this can be used to set/reset a checkpoint for the schema. This update will happen only if the schema is in the AVAILABLE state.

UPDATE aws.glue.schemas
SET
SchemaId = '{{ SchemaId }}',
SchemaVersionNumber = '{{ SchemaVersionNumber }}',
Compatibility = '{{ Compatibility }}',
Description = '{{ Description }}'
WHERE
region = '{{ region }}' --required
AND SchemaId = '{{ SchemaId }}' --required
RETURNING
registry_name,
schema_arn,
schema_name;

DELETE examples

Deletes the entire schema set, including the schema set and all of its versions. To get the status of the delete operation, you can call GetSchema API after the asynchronous call. Deleting a registry will deactivate all online operations for the schema, such as the GetSchemaByDefinition, and RegisterSchemaVersion APIs.

DELETE FROM aws.glue.schemas
WHERE region = '{{ region }}' --required
;