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

********
get_plan
********



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

  

  Gets code to perform a specified mapping.

  

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


  **Request Syntax**
  ::

    response = client.get_plan(
        Mapping=[
            {
                'SourceTable': 'string',
                'SourcePath': 'string',
                'SourceType': 'string',
                'TargetTable': 'string',
                'TargetPath': 'string',
                'TargetType': 'string'
            },
        ],
        Source={
            'DatabaseName': 'string',
            'TableName': 'string'
        },
        Sinks=[
            {
                'DatabaseName': 'string',
                'TableName': 'string'
            },
        ],
        Location={
            'Jdbc': [
                {
                    'Name': 'string',
                    'Value': 'string',
                    'Param': True|False
                },
            ],
            'S3': [
                {
                    'Name': 'string',
                    'Value': 'string',
                    'Param': True|False
                },
            ],
            'DynamoDB': [
                {
                    'Name': 'string',
                    'Value': 'string',
                    'Param': True|False
                },
            ]
        },
        Language='PYTHON'|'SCALA',
        AdditionalPlanOptionsMap={
            'string': 'string'
        }
    )
    
  :type Mapping: list
  :param Mapping: **[REQUIRED]** 

    The list of mappings from a source table to target tables.

    

  
    - *(dict) --* 

      Defines a mapping.

      

    
      - **SourceTable** *(string) --* 

        The name of the source table.

        

      
      - **SourcePath** *(string) --* 

        The source path.

        

      
      - **SourceType** *(string) --* 

        The source type.

        

      
      - **TargetTable** *(string) --* 

        The target table.

        

      
      - **TargetPath** *(string) --* 

        The target path.

        

      
      - **TargetType** *(string) --* 

        The target type.

        

      
    

  :type Source: dict
  :param Source: **[REQUIRED]** 

    The source table.

    

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

      The database in which the table metadata resides.

      

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

      The name of the table in question.

      

    
  
  :type Sinks: list
  :param Sinks: 

    The target tables.

    

  
    - *(dict) --* 

      Specifies a table definition in the Glue Data Catalog.

      

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

        The database in which the table metadata resides.

        

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

        The name of the table in question.

        

      
    

  :type Location: dict
  :param Location: 

    The parameters for the mapping.

    

  
    - **Jdbc** *(list) --* 

      A JDBC location.

      

    
      - *(dict) --* 

        An argument or property of a node.

        

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

          The name of the argument or property.

          

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

          The value of the argument or property.

          

        
        - **Param** *(boolean) --* 

          True if the value is used as a parameter.

          

        
      
  
    - **S3** *(list) --* 

      An Amazon Simple Storage Service (Amazon S3) location.

      

    
      - *(dict) --* 

        An argument or property of a node.

        

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

          The name of the argument or property.

          

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

          The value of the argument or property.

          

        
        - **Param** *(boolean) --* 

          True if the value is used as a parameter.

          

        
      
  
    - **DynamoDB** *(list) --* 

      An Amazon DynamoDB table location.

      

    
      - *(dict) --* 

        An argument or property of a node.

        

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

          The name of the argument or property.

          

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

          The value of the argument or property.

          

        
        - **Param** *(boolean) --* 

          True if the value is used as a parameter.

          

        
      
  
  
  :type Language: string
  :param Language: 

    The programming language of the code to perform the mapping.

    

  
  :type AdditionalPlanOptionsMap: dict
  :param AdditionalPlanOptionsMap: 

    A map to hold additional optional key-value parameters.

     

    Currently, these key-value pairs are supported:

     

    
    * ``inferSchema``  — Specifies whether to set ``inferSchema`` to true or false for the default script generated by an Glue job. For example, to set ``inferSchema`` to true, pass the following key value pair: ``--additional-plan-options-map '{"inferSchema":"true"}'``
    

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'PythonScript': 'string',
          'ScalaCode': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **PythonScript** *(string) --* 

        A Python script to perform the mapping.

        
      

      - **ScalaCode** *(string) --* 

        The Scala code to perform the mapping.

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

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

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

  