:doc:`Glue <../../glue>` / Client / get_entity_records

******************
get_entity_records
******************



.. py:method:: Glue.Client.get_entity_records(**kwargs)

  

  This API is used to query preview data from a given connection type or from a native Amazon S3 based Glue Data Catalog.

   

  Returns records as an array of JSON blobs. Each record is formatted using Jackson JsonNode based on the field type defined by the ``DescribeEntity`` API.

   

  Spark connectors generate schemas according to the same data type mapping as in the ``DescribeEntity`` API. Spark connectors convert data to the appropriate data types matching the schema when returning rows.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetEntityRecords>`_  


  **Request Syntax**
  ::

    response = client.get_entity_records(
        ConnectionName='string',
        CatalogId='string',
        EntityName='string',
        NextToken='string',
        DataStoreApiVersion='string',
        ConnectionOptions={
            'string': 'string'
        },
        FilterPredicate='string',
        Limit=123,
        OrderBy='string',
        SelectedFields=[
            'string',
        ]
    )
    
  :type ConnectionName: string
  :param ConnectionName: 

    The name of the connection that contains the connection type credentials.

    

  
  :type CatalogId: string
  :param CatalogId: 

    The catalog ID of the catalog that contains the connection. This can be null, By default, the Amazon Web Services Account ID is the catalog ID.

    

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

    Name of the entity that we want to query the preview data from the given connection type.

    

  
  :type NextToken: string
  :param NextToken: 

    A continuation token, included if this is a continuation call.

    

  
  :type DataStoreApiVersion: string
  :param DataStoreApiVersion: 

    The API version of the SaaS connector.

    

  
  :type ConnectionOptions: dict
  :param ConnectionOptions: 

    Connector options that are required to query the data.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


  :type FilterPredicate: string
  :param FilterPredicate: 

    A filter predicate that you can apply in the query request.

    

  
  :type Limit: integer
  :param Limit: **[REQUIRED]** 

    Limits the number of records fetched with the request.

    

  
  :type OrderBy: string
  :param OrderBy: 

    A parameter that orders the response preview data.

    

  
  :type SelectedFields: list
  :param SelectedFields: 

    List of fields that we want to fetch as part of preview data.

    

  
    - *(string) --* 

    

  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'Records': [
              {...}|[...]|123|123.4|'string'|True|None,
          ],
          'NextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Records** *(list) --* 

        A list of the requested objects.

        
        

        - (:ref:`document<document>`) -- 
    
      

      - **NextToken** *(string) --* 

        A continuation token, present if the current segment is not the last.

        
  
  **Exceptions**
  
  *   :py:class:`Glue.Client.exceptions.EntityNotFoundException`

  
  *   :py:class:`Glue.Client.exceptions.OperationTimeoutException`

  
  *   :py:class:`Glue.Client.exceptions.InvalidInputException`

  
  *   :py:class:`Glue.Client.exceptions.GlueEncryptionException`

  
  *   :py:class:`Glue.Client.exceptions.ValidationException`

  
  *   :py:class:`Glue.Client.exceptions.FederationSourceException`

  
  *   :py:class:`Glue.Client.exceptions.AccessDeniedException`

  