TimestreamWrite / Client / create_batch_load_task

create_batch_load_task#

TimestreamWrite.Client.create_batch_load_task(**kwargs)#

Creates a new Timestream batch load task. A batch load task processes data from a CSV source in an S3 location and writes to a Timestream table. A mapping from source to target is defined in a batch load task. Errors and events are written to a report at an S3 location. For the report, if the KMS key is not specified, the batch load task will be encrypted with a Timestream managed KMS key located in your account. For more information, see Amazon Web Services managed keys. Service quotas apply. For details, see code sample.

See also: AWS API Documentation

Request Syntax

response = client.create_batch_load_task(
    ClientToken='string',
    DataModelConfiguration={
        'DataModel': {
            'TimeColumn': 'string',
            'TimeUnit': 'MILLISECONDS'|'SECONDS'|'MICROSECONDS'|'NANOSECONDS',
            'DimensionMappings': [
                {
                    'SourceColumn': 'string',
                    'DestinationColumn': 'string'
                },
            ],
            'MultiMeasureMappings': {
                'TargetMultiMeasureName': 'string',
                'MultiMeasureAttributeMappings': [
                    {
                        'SourceColumn': 'string',
                        'TargetMultiMeasureAttributeName': 'string',
                        'MeasureValueType': 'DOUBLE'|'BIGINT'|'BOOLEAN'|'VARCHAR'|'TIMESTAMP'
                    },
                ]
            },
            'MixedMeasureMappings': [
                {
                    'MeasureName': 'string',
                    'SourceColumn': 'string',
                    'TargetMeasureName': 'string',
                    'MeasureValueType': 'DOUBLE'|'BIGINT'|'VARCHAR'|'BOOLEAN'|'TIMESTAMP'|'MULTI',
                    'MultiMeasureAttributeMappings': [
                        {
                            'SourceColumn': 'string',
                            'TargetMultiMeasureAttributeName': 'string',
                            'MeasureValueType': 'DOUBLE'|'BIGINT'|'BOOLEAN'|'VARCHAR'|'TIMESTAMP'
                        },
                    ]
                },
            ],
            'MeasureNameColumn': 'string'
        },
        'DataModelS3Configuration': {
            'BucketName': 'string',
            'ObjectKey': 'string'
        }
    },
    DataSourceConfiguration={
        'DataSourceS3Configuration': {
            'BucketName': 'string',
            'ObjectKeyPrefix': 'string'
        },
        'CsvConfiguration': {
            'ColumnSeparator': 'string',
            'EscapeChar': 'string',
            'QuoteChar': 'string',
            'NullValue': 'string',
            'TrimWhiteSpace': True|False
        },
        'DataFormat': 'CSV'
    },
    ReportConfiguration={
        'ReportS3Configuration': {
            'BucketName': 'string',
            'ObjectKeyPrefix': 'string',
            'EncryptionOption': 'SSE_S3'|'SSE_KMS',
            'KmsKeyId': 'string'
        }
    },
    TargetDatabaseName='string',
    TargetTableName='string',
    RecordVersion=123
)
Parameters:
  • ClientToken (string) – This field is autopopulated if not provided.

  • DataModelConfiguration (dict) –

    • DataModel (dict) –

      • TimeColumn (string) –

        Source column to be mapped to time.

      • TimeUnit (string) –

        The granularity of the timestamp unit. It indicates if the time value is in seconds, milliseconds, nanoseconds, or other supported values. Default is MILLISECONDS.

      • DimensionMappings (list) – [REQUIRED]

        Source to target mappings for dimensions.

        • (dict) –

          • SourceColumn (string) –

          • DestinationColumn (string) –

      • MultiMeasureMappings (dict) –

        Source to target mappings for multi-measure records.

        • TargetMultiMeasureName (string) –

        • MultiMeasureAttributeMappings (list) – [REQUIRED]

          • (dict) –

            • SourceColumn (string) – [REQUIRED]

            • TargetMultiMeasureAttributeName (string) –

            • MeasureValueType (string) –

      • MixedMeasureMappings (list) –

        Source to target mappings for measures.

        • (dict) –

          • MeasureName (string) –

          • SourceColumn (string) –

          • TargetMeasureName (string) –

          • MeasureValueType (string) – [REQUIRED]

          • MultiMeasureAttributeMappings (list) –

            • (dict) –

              • SourceColumn (string) – [REQUIRED]

              • TargetMultiMeasureAttributeName (string) –

              • MeasureValueType (string) –

      • MeasureNameColumn (string) –

    • DataModelS3Configuration (dict) –

      • BucketName (string) –

      • ObjectKey (string) –

  • DataSourceConfiguration (dict) –

    [REQUIRED]

    Defines configuration details about the data source for a batch load task.

    • DataSourceS3Configuration (dict) – [REQUIRED]

      Configuration of an S3 location for a file which contains data to load.

      • BucketName (string) – [REQUIRED]

        The bucket name of the customer S3 bucket.

      • ObjectKeyPrefix (string) –

    • CsvConfiguration (dict) –

      A delimited data format where the column separator can be a comma and the record separator is a newline character.

      • ColumnSeparator (string) –

        Column separator can be one of comma (‘,’), pipe (’|), semicolon (‘;’), tab(‘/t’), or blank space (’ ‘).

      • EscapeChar (string) –

        Escape character can be one of

      • QuoteChar (string) –

        Can be single quote (’) or double quote (“).

      • NullValue (string) –

        Can be blank space (’ ‘).

      • TrimWhiteSpace (boolean) –

        Specifies to trim leading and trailing white space.

    • DataFormat (string) – [REQUIRED]

      This is currently CSV.

  • ReportConfiguration (dict) –

    [REQUIRED]

    Report configuration for a batch load task. This contains details about where error reports are stored.

    • ReportS3Configuration (dict) –

      Configuration of an S3 location to write error reports and events for a batch load.

      • BucketName (string) – [REQUIRED]

      • ObjectKeyPrefix (string) –

      • EncryptionOption (string) –

      • KmsKeyId (string) –

  • TargetDatabaseName (string) –

    [REQUIRED]

    Target Timestream database for a batch load task.

  • TargetTableName (string) –

    [REQUIRED]

    Target Timestream table for a batch load task.

  • RecordVersion (integer) –

Return type:

dict

Returns:

Response Syntax

{
    'TaskId': 'string'
}

Response Structure

  • (dict) –

    • TaskId (string) –

      The ID of the batch load task.

Exceptions

  • TimestreamWrite.Client.exceptions.InternalServerException

  • TimestreamWrite.Client.exceptions.ThrottlingException

  • TimestreamWrite.Client.exceptions.AccessDeniedException

  • TimestreamWrite.Client.exceptions.ValidationException

  • TimestreamWrite.Client.exceptions.ConflictException

  • TimestreamWrite.Client.exceptions.ResourceNotFoundException

  • TimestreamWrite.Client.exceptions.ServiceQuotaExceededException

  • TimestreamWrite.Client.exceptions.InvalidEndpointException