Athena / Client / list_table_metadata

list_table_metadata#

Athena.Client.list_table_metadata(**kwargs)#

Lists the metadata for the tables in the specified data catalog database.

See also: AWS API Documentation

Request Syntax

response = client.list_table_metadata(
    CatalogName='string',
    DatabaseName='string',
    Expression='string',
    NextToken='string',
    MaxResults=123,
    WorkGroup='string'
)
Parameters:
  • CatalogName (string) –

    [REQUIRED]

    The name of the data catalog for which table metadata should be returned.

  • DatabaseName (string) –

    [REQUIRED]

    The name of the database for which table metadata should be returned.

  • Expression (string) – A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.

  • NextToken (string) – A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

  • MaxResults (integer) – Specifies the maximum number of results to return.

  • WorkGroup (string) – The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog.

Return type:

dict

Returns:

Response Syntax

{
    'TableMetadataList': [
        {
            'Name': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'LastAccessTime': datetime(2015, 1, 1),
            'TableType': 'string',
            'Columns': [
                {
                    'Name': 'string',
                    'Type': 'string',
                    'Comment': 'string'
                },
            ],
            'PartitionKeys': [
                {
                    'Name': 'string',
                    'Type': 'string',
                    'Comment': 'string'
                },
            ],
            'Parameters': {
                'string': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • TableMetadataList (list) –

      A list of table metadata.

      • (dict) –

        Contains metadata for a table.

        • Name (string) –

          The name of the table.

        • CreateTime (datetime) –

          The time that the table was created.

        • LastAccessTime (datetime) –

          The last time the table was accessed.

        • TableType (string) –

          The type of table. In Athena, only EXTERNAL_TABLE is supported.

        • Columns (list) –

          A list of the columns in the table.

          • (dict) –

            Contains metadata for a column in a table.

            • Name (string) –

              The name of the column.

            • Type (string) –

              The data type of the column.

            • Comment (string) –

              Optional information about the column.

        • PartitionKeys (list) –

          A list of the partition keys in the table.

          • (dict) –

            Contains metadata for a column in a table.

            • Name (string) –

              The name of the column.

            • Type (string) –

              The data type of the column.

            • Comment (string) –

              Optional information about the column.

        • Parameters (dict) –

          A set of custom key/value pairs for table properties.

          • (string) –

            • (string) –

    • NextToken (string) –

      A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the NextToken from the response object of the previous page call.

Exceptions