getPlan method
Gets code to perform a specified mapping.
May throw InternalServiceException.
May throw InvalidInputException.
May throw OperationTimeoutException.
Parameter mapping :
The list of mappings from a source table to target tables.
Parameter source :
The source table.
Parameter additionalPlanOptionsMap :
A map to hold additional optional key-value parameters.
Currently, these key-value pairs are supported:
-
inferSchema— Specifies whether to setinferSchemato true or false for the default script generated by an Glue job. For example, to setinferSchemato true, pass the following key value pair:--additional-plan-options-map '{"inferSchema":"true"}'
Parameter language :
The programming language of the code to perform the mapping.
Parameter location :
The parameters for the mapping.
Parameter sinks :
The target tables.
Implementation
Future<GetPlanResponse> getPlan({
required List<MappingEntry> mapping,
required CatalogEntry source,
Map<String, String>? additionalPlanOptionsMap,
Language? language,
Location? location,
List<CatalogEntry>? sinks,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.GetPlan'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Mapping': mapping,
'Source': source,
if (additionalPlanOptionsMap != null)
'AdditionalPlanOptionsMap': additionalPlanOptionsMap,
if (language != null) 'Language': language.value,
if (location != null) 'Location': location,
if (sinks != null) 'Sinks': sinks,
},
);
return GetPlanResponse.fromJson(jsonResponse.body);
}