Menu
AWS Glue
Developer Guide

Database API

Data Types

Database Structure

The Database object represents a logical grouping of tables that may reside in a Hive metastore or an RDBMS.

Fields

  • Name – String, matching the Single-line string pattern. Required.

    Name of the database.

  • Description – Description string, matching the URI address multi-line string pattern.

    Description of the database.

  • LocationUri – Uniform resource identifier (uri), matching the URI address multi-line string pattern.

    The location of the database (for example, an HDFS path).

  • Parameters – An array of UTF-8 string–to–UTF-8 string mappings.

    A list of key-value pairs that define parameters and properties of the database.

  • CreateTime – Timestamp.

    The time at which the metadata database was created in the catalog.

DatabaseInput Structure

The structure used to create or updata a database.

Fields

  • Name – String, matching the Single-line string pattern. Required.

    Name of the database.

  • Description – Description string, matching the URI address multi-line string pattern.

    Description of the database

  • LocationUri – Uniform resource identifier (uri), matching the URI address multi-line string pattern.

    The location of the database (for example, an HDFS path).

  • Parameters – An array of UTF-8 string–to–UTF-8 string mappings.

    A list of key-value pairs that define parameters and properties of the database.

Operations

CreateDatabase Action (Python: create_database)

Creates a new database in a Data Catalog.

Request

  • CatalogId – Catalog id string, matching the Single-line string pattern.

    The ID of the Data Catalog in which to create the database. If none is supplied, the AWS account ID is used by default.

  • DatabaseInput – A DatabaseInput object. Required.

    A DatabaseInput object defining the metadata database to create in the catalog.

Response

  • No Response parameters.

Errors

  • InvalidInputException

  • AlreadyExistsException

  • ResourceNumberLimitExceededException

  • InternalServiceException

  • OperationTimeoutException

Related Hive DDL:

Copy
CREATE (DATABASE|SCHEMA) [IF NOT EXISTS] database_name [COMMENT database_comment] [LOCATION hdfs_path] [WITH DBPROPERTIES (property_name=property_value, ...)];

UpdateDatabase Action (Python: update_database)

Updates an existing database definition in a Data Catalog.

Request

  • CatalogId – Catalog id string, matching the Single-line string pattern.

    The ID of the Data Catalog in which the metadata database resides. If none is supplied, the AWS account ID is used by default.

  • Name – String, matching the Single-line string pattern. Required.

    The name of the metadata database to update in the catalog.

  • DatabaseInput – A DatabaseInput object. Required.

    A DatabaseInput object specifying the new definition of the metadata database in the catalog.

Response

  • No Response parameters.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

DeleteDatabase Action (Python: delete_database)

Removes a specified Database from a Data Catalog.

Request

  • CatalogId – Catalog id string, matching the Single-line string pattern.

    The ID of the Data Catalog in which the database resides. If none is supplied, the AWS account ID is used by default.

  • Name – String, matching the Single-line string pattern. Required.

    The name of the Database to delete.

Response

  • No Response parameters.

Errors

  • EntityNotFoundException

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException

GetDatabase Action (Python: get_database)

Retrieves the definition of a specified database.

Request

  • CatalogId – Catalog id string, matching the Single-line string pattern.

    The ID of the Data Catalog in which the database resides. If none is supplied, the AWS account ID is used by default.

  • Name – String, matching the Single-line string pattern. Required.

    The name of the database to retrieve.

Response

  • Database – A Database object.

    The definition of the specified database in the catalog.

Errors

  • InvalidInputException

  • EntityNotFoundException

  • InternalServiceException

  • OperationTimeoutException

GetDatabases Action (Python: get_databases)

Retrieves all Databases defined in a given Data Catalog.

Request

  • CatalogId – Catalog id string, matching the Single-line string pattern.

    The ID of the Data Catalog from which to retrieve Databases. If none is supplied, the AWS account ID is used by default.

  • NextToken – String.

    A continuation token, if this is a continuation call.

  • MaxResults – Number (integer).

    The maximum number of databases to return in one response.

Response

  • DatabaseList – An array of Databases. Required.

    A list of Database objects from the specified catalog.

  • NextToken – String.

    A continuation token for paginating the returned list of tokens, returned if the current segment of the list is not the last.

Errors

  • InvalidInputException

  • InternalServiceException

  • OperationTimeoutException