createDataLakeDataset method
Enables you to programmatically create an Amazon Web Services Supply Chain data lake dataset. Developers can create the datasets using their pre-defined or custom schema for a given instance ID, namespace, and dataset name.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter instanceId :
The Amazon Web Services Supply Chain instance identifier.
Parameter name :
The name of the dataset. For asc name space, the name must be one
of the supported data entities under https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html.
Parameter namespace :
The namespace of the dataset, besides the custom defined namespace, every
instance comes with below pre-defined namespaces:
- asc - For information on the Amazon Web Services Supply Chain supported datasets see https://docs.aws.amazon.com/aws-supply-chain/latest/userguide/data-model-asc.html.
- default - For datasets with custom user-defined schemas.
Parameter description :
The description of the dataset.
Parameter partitionSpec :
The partition specification of the dataset. Partitioning can effectively
improve the dataset query performance by reducing the amount of data
scanned during query execution. But partitioning or not will affect how
data get ingested by data ingestion methods, such as
SendDataIntegrationEvent's dataset UPSERT will upsert records within
partition (instead of within whole dataset). For more details, refer to
those data ingestion documentations.
Parameter schema :
The custom schema of the data lake dataset and required for dataset in
default and custom namespaces.
Parameter tags :
The tags of the dataset.
Implementation
Future<CreateDataLakeDatasetResponse> createDataLakeDataset({
required String instanceId,
required String name,
required String namespace,
String? description,
DataLakeDatasetPartitionSpec? partitionSpec,
DataLakeDatasetSchema? schema,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
if (description != null) 'description': description,
if (partitionSpec != null) 'partitionSpec': partitionSpec,
if (schema != null) 'schema': schema,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri:
'/api/datalake/instance/${Uri.encodeComponent(instanceId)}/namespaces/${Uri.encodeComponent(namespace)}/datasets/${Uri.encodeComponent(name)}',
exceptionFnMap: _exceptionFns,
);
return CreateDataLakeDatasetResponse.fromJson(response);
}