:doc:`Athena <../../athena>` / Client / list_table_metadata

*******************
list_table_metadata
*******************



.. py:method:: Athena.Client.list_table_metadata(**kwargs)

  

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

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/ListTableMetadata>`_  


  **Request Syntax**
  ::

    response = client.list_table_metadata(
        CatalogName='string',
        DatabaseName='string',
        Expression='string',
        NextToken='string',
        MaxResults=123,
        WorkGroup='string'
    )
    
  :type CatalogName: string
  :param CatalogName: **[REQUIRED]** 

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

    

  
  :type DatabaseName: string
  :param DatabaseName: **[REQUIRED]** 

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

    

  
  :type Expression: string
  :param Expression: 

    A regex filter that pattern-matches table names. If no expression is supplied, metadata for all tables are listed.

    

  
  :type NextToken: string
  :param NextToken: 

    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.

    

  
  :type MaxResults: integer
  :param MaxResults: 

    Specifies the maximum number of results to return.

    

  
  :type WorkGroup: string
  :param WorkGroup: 

    The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog.

    

  
  
  :rtype: 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**
  
  *   :py:class:`Athena.Client.exceptions.InternalServerException`

  
  *   :py:class:`Athena.Client.exceptions.InvalidRequestException`

  
  *   :py:class:`Athena.Client.exceptions.MetadataException`

  