create_data_lake_dataset
async
¶
create_data_lake_dataset(
instance_id: UUID,
namespace: DataLakeNamespaceName,
name: DataLakeDatasetName,
*,
config_overrides: Optional[AsyncSupplyChainClientConfig] = None,
schema: Optional[DataLakeDatasetSchema] = None,
description: Optional[DataLakeDatasetDescription] = None,
partition_spec: Optional[DataLakeDatasetPartitionSpec] = None,
tags: Optional[TagMap] = None,
) -> CreateDataLakeDatasetResponse
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.
Parameters:
-
instance_id(UUID) –The Amazon Web Services Supply Chain instance identifier.
-
namespace(DataLakeNamespaceName) –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.
-
-
name(DataLakeDatasetName) –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.
-
schema(Optional[DataLakeDatasetSchema], default:None) –The custom schema of the data lake dataset and required for dataset in default and custom namespaces.
-
description(Optional[DataLakeDatasetDescription], default:None) –The description of the dataset.
-
partition_spec(Optional[DataLakeDatasetPartitionSpec], default:None) –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.
-
tags(Optional[TagMap], default:None) –The tags of the dataset.
Raises:
-
AccessDeniedException–You do not have the required privileges to perform this action.
-
ConflictException–Updating or deleting a resource can cause an inconsistent state.
-
InternalServerException–Unexpected error during processing of request.
-
ResourceNotFoundException–Request references a resource which does not exist.
-
ServiceQuotaExceededException–Request would cause a service quota to be exceeded.
-
ThrottlingException–Request was denied due to request throttling.
-
ValidationException–The input does not satisfy the constraints specified by an AWS service.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
Create an AWS Supply Chain inbound order dataset
>>> await client.create_data_lake_dataset(instance_id='1877dd20-dee9-4639-8e99-cb67acf21fe5', namespace='asc', name='inbound_order', description='This is an AWS Supply Chain inbound order dataset', tags={'tagKey1': 'tagValue1', 'tagKey2': 'tagValue2'})
Create a custom dataset
>>> await client.create_data_lake_dataset(instance_id='1877dd20-dee9-4639-8e99-cb67acf21fe5', namespace='default', name='my_dataset', description='This is a custom dataset', schema={'name': 'MyDataset', 'fields': [{'name': 'id', 'type': 'INT', 'isRequired': True}, {'name': 'description', 'type': 'STRING', 'isRequired': True}, {'name': 'price', 'type': 'DOUBLE', 'isRequired': False}, {'name': 'creation_time', 'type': 'TIMESTAMP', 'isRequired': False}, {'name': 'quantity', 'type': 'LONG', 'isRequired': False}], 'primaryKeys': [{'name': 'id'}]}, partition_spec={'fields': [{'name': 'creation_time', 'transform': {'type': 'DAY'}}, {'name': 'description', 'transform': {'type': 'IDENTITY'}}]}, tags={'tagKey1': 'tagValue1', 'tagKey2': 'tagValue2'})
Source code in docs_src/capo_supplychain/_services/async_supply_chain.py
1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 | |