:doc:`EntityResolution <../../entityresolution>` / Client / create_schema_mapping

*********************
create_schema_mapping
*********************



.. py:method:: EntityResolution.Client.create_schema_mapping(**kwargs)

  

  Creates a schema mapping, which defines the schema of the input customer records table. The ``SchemaMapping`` also provides Entity Resolution with some metadata about the table, such as the attribute types of the columns and which columns to match on.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/entityresolution-2018-05-10/CreateSchemaMapping>`_  


  **Request Syntax**
  ::

    response = client.create_schema_mapping(
        schemaName='string',
        description='string',
        mappedInputFields=[
            {
                'fieldName': 'string',
                'type': 'NAME'|'NAME_FIRST'|'NAME_MIDDLE'|'NAME_LAST'|'ADDRESS'|'ADDRESS_STREET1'|'ADDRESS_STREET2'|'ADDRESS_STREET3'|'ADDRESS_CITY'|'ADDRESS_STATE'|'ADDRESS_COUNTRY'|'ADDRESS_POSTALCODE'|'PHONE'|'PHONE_NUMBER'|'PHONE_COUNTRYCODE'|'EMAIL_ADDRESS'|'UNIQUE_ID'|'DATE'|'STRING'|'PROVIDER_ID'|'IPV4'|'IPV6'|'MAID',
                'groupName': 'string',
                'matchKey': 'string',
                'subType': 'string',
                'hashed': True|False
            },
        ],
        tags={
            'string': 'string'
        }
    )
    
  :type schemaName: string
  :param schemaName: **[REQUIRED]** 

    The name of the schema. There can't be multiple ``SchemaMappings`` with the same name.

    

  
  :type description: string
  :param description: 

    A description of the schema.

    

  
  :type mappedInputFields: list
  :param mappedInputFields: **[REQUIRED]** 

    A list of ``MappedInputFields``. Each ``MappedInputField`` corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.

    

  
    - *(dict) --* 

      A configuration object for defining input data fields in Entity Resolution. The ``SchemaInputAttribute`` specifies how individual fields in your input data should be processed and matched.

      

    
      - **fieldName** *(string) --* **[REQUIRED]** 

        A string containing the field name.

        

      
      - **type** *(string) --* **[REQUIRED]** 

        The type of the attribute, selected from a list of values.

         

        LiveRamp supports: ``NAME`` | ``NAME_FIRST`` | ``NAME_MIDDLE`` | ``NAME_LAST`` | ``ADDRESS`` | ``ADDRESS_STREET1`` | ``ADDRESS_STREET2`` | ``ADDRESS_STREET3`` | ``ADDRESS_CITY`` | ``ADDRESS_STATE`` | ``ADDRESS_COUNTRY`` | ``ADDRESS_POSTALCODE`` | ``PHONE`` | ``PHONE_NUMBER`` | ``EMAIL_ADDRESS`` | ``UNIQUE_ID`` | ``PROVIDER_ID``

         

        TransUnion supports: ``NAME`` | ``NAME_FIRST`` | ``NAME_LAST`` | ``ADDRESS`` | ``ADDRESS_CITY`` | ``ADDRESS_STATE`` | ``ADDRESS_COUNTRY`` | ``ADDRESS_POSTALCODE`` | ``PHONE_NUMBER`` | ``EMAIL_ADDRESS`` | ``UNIQUE_ID`` | ``IPV4`` | ``IPV6`` | ``MAID``

         

        Unified ID 2.0 supports: ``PHONE_NUMBER`` | ``EMAIL_ADDRESS`` | ``UNIQUE_ID``

         

        .. note::

          

          Normalization is only supported for ``NAME``, ``ADDRESS``, ``PHONE``, and ``EMAIL_ADDRESS``.

           

          If you want to normalize ``NAME_FIRST``, ``NAME_MIDDLE``, and ``NAME_LAST``, you must group them by assigning them to the ``NAME`` ``groupName``.

           

          If you want to normalize ``ADDRESS_STREET1``, ``ADDRESS_STREET2``, ``ADDRESS_STREET3``, ``ADDRESS_CITY``, ``ADDRESS_STATE``, ``ADDRESS_COUNTRY``, and ``ADDRESS_POSTALCODE``, you must group them by assigning them to the ``ADDRESS`` ``groupName``.

           

          If you want to normalize ``PHONE_NUMBER`` and ``PHONE_COUNTRYCODE``, you must group them by assigning them to the ``PHONE`` ``groupName``.

          

        

      
      - **groupName** *(string) --* 

        A string that instructs Entity Resolution to combine several columns into a unified column with the identical attribute type.

         

        For example, when working with columns such as ``NAME_FIRST``, ``NAME_MIDDLE``, and ``NAME_LAST``, assigning them a common ``groupName`` will prompt Entity Resolution to concatenate them into a single value.

        

      
      - **matchKey** *(string) --* 

        A key that allows grouping of multiple input attributes into a unified matching group.

         

        For example, consider a scenario where the source table contains various addresses, such as ``business_address`` and ``shipping_address``. By assigning a ``matchKey`` called ``address`` to both attributes, Entity Resolution will match records across these fields to create a consolidated matching group.

         

        If no ``matchKey`` is specified for a column, it won't be utilized for matching purposes but will still be included in the output table.

        

      
      - **subType** *(string) --* 

        The subtype of the attribute, selected from a list of values.

        

      
      - **hashed** *(boolean) --* 

        Indicates if the column values are hashed in the schema input.

         

        If the value is set to ``TRUE``, the column values are hashed.

         

        If the value is set to ``FALSE``, the column values are cleartext.

        

      
    

  :type tags: dict
  :param tags: 

    The tags used to organize, track, or control access for this resource.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'schemaName': 'string',
          'schemaArn': 'string',
          'description': 'string',
          'mappedInputFields': [
              {
                  'fieldName': 'string',
                  'type': 'NAME'|'NAME_FIRST'|'NAME_MIDDLE'|'NAME_LAST'|'ADDRESS'|'ADDRESS_STREET1'|'ADDRESS_STREET2'|'ADDRESS_STREET3'|'ADDRESS_CITY'|'ADDRESS_STATE'|'ADDRESS_COUNTRY'|'ADDRESS_POSTALCODE'|'PHONE'|'PHONE_NUMBER'|'PHONE_COUNTRYCODE'|'EMAIL_ADDRESS'|'UNIQUE_ID'|'DATE'|'STRING'|'PROVIDER_ID'|'IPV4'|'IPV6'|'MAID',
                  'groupName': 'string',
                  'matchKey': 'string',
                  'subType': 'string',
                  'hashed': True|False
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **schemaName** *(string) --* 

        The name of the schema.

        
      

      - **schemaArn** *(string) --* 

        The ARN (Amazon Resource Name) that Entity Resolution generated for the ``SchemaMapping``.

        
      

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

        A description of the schema.

        
      

      - **mappedInputFields** *(list) --* 

        A list of ``MappedInputFields``. Each ``MappedInputField`` corresponds to a column the source data table, and contains column name plus additional information that Entity Resolution uses for matching.

        
        

        - *(dict) --* 

          A configuration object for defining input data fields in Entity Resolution. The ``SchemaInputAttribute`` specifies how individual fields in your input data should be processed and matched.

          
          

          - **fieldName** *(string) --* 

            A string containing the field name.

            
          

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

            The type of the attribute, selected from a list of values.

             

            LiveRamp supports: ``NAME`` | ``NAME_FIRST`` | ``NAME_MIDDLE`` | ``NAME_LAST`` | ``ADDRESS`` | ``ADDRESS_STREET1`` | ``ADDRESS_STREET2`` | ``ADDRESS_STREET3`` | ``ADDRESS_CITY`` | ``ADDRESS_STATE`` | ``ADDRESS_COUNTRY`` | ``ADDRESS_POSTALCODE`` | ``PHONE`` | ``PHONE_NUMBER`` | ``EMAIL_ADDRESS`` | ``UNIQUE_ID`` | ``PROVIDER_ID``

             

            TransUnion supports: ``NAME`` | ``NAME_FIRST`` | ``NAME_LAST`` | ``ADDRESS`` | ``ADDRESS_CITY`` | ``ADDRESS_STATE`` | ``ADDRESS_COUNTRY`` | ``ADDRESS_POSTALCODE`` | ``PHONE_NUMBER`` | ``EMAIL_ADDRESS`` | ``UNIQUE_ID`` | ``IPV4`` | ``IPV6`` | ``MAID``

             

            Unified ID 2.0 supports: ``PHONE_NUMBER`` | ``EMAIL_ADDRESS`` | ``UNIQUE_ID``

             

            .. note::

              

              Normalization is only supported for ``NAME``, ``ADDRESS``, ``PHONE``, and ``EMAIL_ADDRESS``.

               

              If you want to normalize ``NAME_FIRST``, ``NAME_MIDDLE``, and ``NAME_LAST``, you must group them by assigning them to the ``NAME`` ``groupName``.

               

              If you want to normalize ``ADDRESS_STREET1``, ``ADDRESS_STREET2``, ``ADDRESS_STREET3``, ``ADDRESS_CITY``, ``ADDRESS_STATE``, ``ADDRESS_COUNTRY``, and ``ADDRESS_POSTALCODE``, you must group them by assigning them to the ``ADDRESS`` ``groupName``.

               

              If you want to normalize ``PHONE_NUMBER`` and ``PHONE_COUNTRYCODE``, you must group them by assigning them to the ``PHONE`` ``groupName``.

              

            
          

          - **groupName** *(string) --* 

            A string that instructs Entity Resolution to combine several columns into a unified column with the identical attribute type.

             

            For example, when working with columns such as ``NAME_FIRST``, ``NAME_MIDDLE``, and ``NAME_LAST``, assigning them a common ``groupName`` will prompt Entity Resolution to concatenate them into a single value.

            
          

          - **matchKey** *(string) --* 

            A key that allows grouping of multiple input attributes into a unified matching group.

             

            For example, consider a scenario where the source table contains various addresses, such as ``business_address`` and ``shipping_address``. By assigning a ``matchKey`` called ``address`` to both attributes, Entity Resolution will match records across these fields to create a consolidated matching group.

             

            If no ``matchKey`` is specified for a column, it won't be utilized for matching purposes but will still be included in the output table.

            
          

          - **subType** *(string) --* 

            The subtype of the attribute, selected from a list of values.

            
          

          - **hashed** *(boolean) --* 

            Indicates if the column values are hashed in the schema input.

             

            If the value is set to ``TRUE``, the column values are hashed.

             

            If the value is set to ``FALSE``, the column values are cleartext.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`EntityResolution.Client.exceptions.ThrottlingException`

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

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

  
  *   :py:class:`EntityResolution.Client.exceptions.ExceedsLimitException`

  
  *   :py:class:`EntityResolution.Client.exceptions.ConflictException`

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

  