:doc:`CleanRoomsService <../../cleanrooms>` / Client / get_schema

**********
get_schema
**********



.. py:method:: CleanRoomsService.Client.get_schema(**kwargs)

  

  Retrieves the schema for a relation within a collaboration.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/cleanrooms-2022-02-17/GetSchema>`_  


  **Request Syntax**
  ::

    response = client.get_schema(
        collaborationIdentifier='string',
        name='string'
    )
    
  :type collaborationIdentifier: string
  :param collaborationIdentifier: **[REQUIRED]** 

    A unique identifier for the collaboration that the schema belongs to. Currently accepts a collaboration ID.

    

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

    The name of the relation to retrieve the schema for.

    

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

    
    ::

      {
          'schema': {
              'columns': [
                  {
                      'name': 'string',
                      'type': 'string'
                  },
              ],
              'partitionKeys': [
                  {
                      'name': 'string',
                      'type': 'string'
                  },
              ],
              'analysisRuleTypes': [
                  'AGGREGATION'|'LIST'|'CUSTOM'|'ID_MAPPING_TABLE',
              ],
              'analysisMethod': 'DIRECT_QUERY'|'DIRECT_JOB'|'MULTIPLE',
              'selectedAnalysisMethods': [
                  'DIRECT_QUERY'|'DIRECT_JOB',
              ],
              'creatorAccountId': 'string',
              'name': 'string',
              'collaborationId': 'string',
              'collaborationArn': 'string',
              'description': 'string',
              'createTime': datetime(2015, 1, 1),
              'updateTime': datetime(2015, 1, 1),
              'type': 'TABLE'|'ID_MAPPING_TABLE',
              'schemaStatusDetails': [
                  {
                      'status': 'READY'|'NOT_READY',
                      'reasons': [
                          {
                              'code': 'ANALYSIS_RULE_MISSING'|'ANALYSIS_TEMPLATES_NOT_CONFIGURED'|'ANALYSIS_PROVIDERS_NOT_CONFIGURED'|'DIFFERENTIAL_PRIVACY_POLICY_NOT_CONFIGURED'|'ID_MAPPING_TABLE_NOT_POPULATED'|'COLLABORATION_ANALYSIS_RULE_NOT_CONFIGURED'|'ADDITIONAL_ANALYSES_NOT_CONFIGURED'|'RESULT_RECEIVERS_NOT_CONFIGURED'|'ADDITIONAL_ANALYSES_NOT_ALLOWED'|'RESULT_RECEIVERS_NOT_ALLOWED'|'ANALYSIS_RULE_TYPES_NOT_COMPATIBLE',
                              'message': 'string'
                          },
                      ],
                      'analysisRuleType': 'AGGREGATION'|'LIST'|'CUSTOM'|'ID_MAPPING_TABLE',
                      'configurations': [
                          'DIFFERENTIAL_PRIVACY',
                      ],
                      'analysisType': 'DIRECT_ANALYSIS'|'ADDITIONAL_ANALYSIS'
                  },
              ],
              'resourceArn': 'string',
              'schemaTypeProperties': {
                  'idMappingTable': {
                      'idMappingTableInputSource': [
                          {
                              'idNamespaceAssociationId': 'string',
                              'type': 'SOURCE'|'TARGET'
                          },
                      ]
                  }
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **schema** *(dict) --* 

        The entire schema object.

        
        

        - **columns** *(list) --* 

          The columns for the relation that this schema represents.

          
          

          - *(dict) --* 

            A column within a schema relation, derived from the underlying table.

            
            

            - **name** *(string) --* 

              The name of the column.

              
            

            - **type** *(string) --* 

              The type of the column.

              
        
      
        

        - **partitionKeys** *(list) --* 

          The partition keys for the dataset underlying this schema.

          
          

          - *(dict) --* 

            A column within a schema relation, derived from the underlying table.

            
            

            - **name** *(string) --* 

              The name of the column.

              
            

            - **type** *(string) --* 

              The type of the column.

              
        
      
        

        - **analysisRuleTypes** *(list) --* 

          The analysis rule types that are associated with the schema. Currently, only one entry is present.

          
          

          - *(string) --* 
      
        

        - **analysisMethod** *(string) --* 

          The analysis method for the schema.

           

          ``DIRECT_QUERY`` allows SQL queries to be run directly on this table.

           

          ``DIRECT_JOB`` allows PySpark jobs to be run directly on this table.

           

          ``MULTIPLE`` allows both SQL queries and PySpark jobs to be run directly on this table.

          
        

        - **selectedAnalysisMethods** *(list) --* 

          The selected analysis methods for the schema.

          
          

          - *(string) --* 
      
        

        - **creatorAccountId** *(string) --* 

          The unique account ID for the Amazon Web Services account that owns the schema.

          
        

        - **name** *(string) --* 

          A name for the schema. The schema relation is referred to by this name when queried by a protected query.

          
        

        - **collaborationId** *(string) --* 

          The unique ID for the collaboration that the schema belongs to.

          
        

        - **collaborationArn** *(string) --* 

          The unique Amazon Resource Name (ARN) for the collaboration that the schema belongs to.

          
        

        - **description** *(string) --* 

          A description for the schema.

          
        

        - **createTime** *(datetime) --* 

          The time at which the schema was created.

          
        

        - **updateTime** *(datetime) --* 

          The most recent time at which the schema was updated.

          
        

        - **type** *(string) --* 

          The type of schema.

          
        

        - **schemaStatusDetails** *(list) --* 

          Details about the status of the schema. Currently, only one entry is present.

          
          

          - *(dict) --* 

            Information about the schema status.

             

            A status of ``READY`` means that based on the schema analysis rule, queries of the given analysis rule type are properly configured to run queries on this schema.

            
            

            - **status** *(string) --* 

              The status of the schema, indicating if it is ready to query.

              
            

            - **reasons** *(list) --* 

              The reasons why the schema status is set to its current state.

              
              

              - *(dict) --* 

                A reason why the schema status is set to its current value.

                
                

                - **code** *(string) --* 

                  The schema status reason code.

                  
                

                - **message** *(string) --* 

                  An explanation of the schema status reason code.

                  
            
          
            

            - **analysisRuleType** *(string) --* 

              The analysis rule type for which the schema status has been evaluated.

              
            

            - **configurations** *(list) --* 

              The configuration details of the schema analysis rule for the given type.

              
              

              - *(string) --* 
          
            

            - **analysisType** *(string) --* 

              The type of analysis that can be performed on the schema.

               

              A schema can have an ``analysisType`` of ``DIRECT_ANALYSIS``, ``ADDITIONAL_ANALYSIS_FOR_AUDIENCE_GENERATION``, or both.

              
        
      
        

        - **resourceArn** *(string) --* 

          The Amazon Resource Name (ARN) of the schema resource.

          
        

        - **schemaTypeProperties** *(dict) --* 

          The schema type properties.

          .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``idMappingTable``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                    'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


        
          

          - **idMappingTable** *(dict) --* 

            The ID mapping table for the schema type properties.

            
            

            - **idMappingTableInputSource** *(list) --* 

              Defines which ID namespace associations are used to create the ID mapping table.

              
              

              - *(dict) --* 

                The input source of the ID mapping table.

                
                

                - **idNamespaceAssociationId** *(string) --* 

                  The unique identifier of the ID namespace association.

                  
                

                - **type** *(string) --* 

                  The type of the input source of the ID mapping table.

                  
            
          
        
      
    
  
  **Exceptions**
  
  *   :py:class:`CleanRoomsService.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CleanRoomsService.Client.exceptions.InternalServerException`

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

  
  *   :py:class:`CleanRoomsService.Client.exceptions.ThrottlingException`

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

  