Skip to main content

datasets

Creates, updates, deletes, gets or lists a datasets resource.

Overview

Namedatasets
TypeResource
Idaws.personalize.datasets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the dataset. (pattern: <code>^[a-zA-Z0-9][a-zA-Z0-9-_]*</code>)
creation_date_timestring (date-time)The creation date and time (in Unix time) of the dataset.
dataset_arnstringThe Amazon Resource Name (ARN) of the dataset that you want metadata for. (pattern: <code>arn:([a-z\d-]+):personalize:.:.:.+</code>)
dataset_group_arnstringThe Amazon Resource Name (ARN) of the dataset group. (pattern: <code>arn:([a-z\d-]+):personalize:.:.:.+</code>)
dataset_typestringOne of the following values: Interactions Items Users Actions Action_Interactions (pattern: <code>^[A-Za-z_]+$</code>)
last_updated_date_timestring (date-time)A time stamp that shows when the dataset was updated.
latest_dataset_updateobjectDescribes the latest update to the dataset.
schema_arnstringThe ARN of the associated schema. (pattern: <code>arn:([a-z\d-]+):personalize:.:.:.+</code>)
statusstringThe status of the dataset. A dataset can be in one of the following states: CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED DELETE PENDING > DELETE IN_PROGRESS
tracking_idstringThe ID of the event tracker for an Action interactions dataset. You specify the tracker's ID in the PutActionInteractions API operation. Amazon Personalize uses it to direct new data to the Action interactions dataset in your dataset group.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_datasetselectregionDescribes the given dataset. For more information on datasets, see CreateDataset.
list_datasetsselectregionReturns the list of datasets contained in the given dataset group. The response provides the properties for each dataset, including the Amazon Resource Name (ARN). For more information on datasets, see CreateDataset.
create_datasetinsertregion, name, schemaArn, datasetGroupArn, datasetTypeCreates an empty dataset and adds it to the specified dataset group. Use CreateDatasetImportJob to import your training data to a dataset. There are 5 types of datasets: Item interactions Items Users Action interactions Actions Each dataset type has an associated schema with required field types. Only the Item interactions dataset is required in order to train a model (also referred to as creating a solution). A dataset can be in one of the following states: CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED DELETE PENDING > DELETE IN_PROGRESS To get the status of the dataset, call DescribeDataset. Related APIs CreateDatasetGroup ListDatasets DescribeDataset DeleteDataset
update_datasetupdateregion, datasetArn, schemaArnUpdate a dataset to replace its schema with a new or existing one. For more information, see Replacing a dataset's schema.
delete_datasetdeleteregionDeletes a dataset. You can't delete a dataset if an associated DatasetImportJob or SolutionVersion is in the CREATE PENDING or IN PROGRESS state. For more information about deleting datasets, see Deleting a dataset.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Describes the given dataset. For more information on datasets, see CreateDataset.

SELECT
name,
creation_date_time,
dataset_arn,
dataset_group_arn,
dataset_type,
last_updated_date_time,
latest_dataset_update,
schema_arn,
status,
tracking_id
FROM aws.personalize.datasets
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates an empty dataset and adds it to the specified dataset group. Use CreateDatasetImportJob to import your training data to a dataset. There are 5 types of datasets: Item interactions Items Users Action interactions Actions Each dataset type has an associated schema with required field types. Only the Item interactions dataset is required in order to train a model (also referred to as creating a solution). A dataset can be in one of the following states: CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED DELETE PENDING > DELETE IN_PROGRESS To get the status of the dataset, call DescribeDataset. Related APIs CreateDatasetGroup ListDatasets DescribeDataset DeleteDataset

INSERT INTO aws.personalize.datasets (
name,
schemaArn,
datasetGroupArn,
datasetType,
tags,
region
)
SELECT
'{{ name }}' /* required */,
'{{ schemaArn }}' /* required */,
'{{ datasetGroupArn }}' /* required */,
'{{ datasetType }}' /* required */,
'{{ tags }}',
'{{ region }}'
RETURNING
dataset_arn
;

UPDATE examples

Update a dataset to replace its schema with a new or existing one. For more information, see Replacing a dataset's schema.

UPDATE aws.personalize.datasets
SET
datasetArn = '{{ datasetArn }}',
schemaArn = '{{ schemaArn }}'
WHERE
region = '{{ region }}' --required
AND datasetArn = '{{ datasetArn }}' --required
AND schemaArn = '{{ schemaArn }}' --required
RETURNING
dataset_arn;

DELETE examples

Deletes a dataset. You can't delete a dataset if an associated DatasetImportJob or SolutionVersion is in the CREATE PENDING or IN PROGRESS state. For more information about deleting datasets, see Deleting a dataset.

DELETE FROM aws.personalize.datasets
WHERE region = '{{ region }}' --required
;