Salta al contenuto

rejected records error

0

I am recieving the following error when trying to test a lambda function to write to timestream:

RejectedRecords:  An error occurred (RejectedRecordsException) when calling the WriteRecords operation: One or more records have been rejected. See RejectedRecords for details.
Rejected Index 0: Multi measure name already has an assigned measure value type. Each multi measure name can have only one measure value type and cannot be changed.
Other records were written successfully. 

This is the code for my 'records' array:

    records = [{
    'Dimensions': dimensions,
    'Time': CURRENT_TIME,
    'MeasureName': 'measurementvalues',
    'MeasureValueType': 'MULTI',
    'MeasureValues': [
    {'Name': 'rainfall_mm', 'Value': str(event["rain_mm"]), 'Type': 'DOUBLE'},
    {'Name': 'Temperature', 'Value': str(event["temperature_C"]), 'Type': 'DOUBLE'},
    {'Name': 'humidity', 'Value': str(event["humidity"]), 'Type': 'BIGINT'},
    {'Name': 'wind_max_m_s', 'Value': str(event["wind_max_m_s"]), 'Type': 'DOUBLE'},
    {'Name': 'wind_avg_m_s', 'Value': str(event["wind_avg_m_s"]), 'Type': 'DOUBLE'},
    {'Name': 'wind_dir_deg', 'Value': str(event["wind_dir_deg"]), 'Type': 'DOUBLE'},
    {'Name': 'Battery_check', 'Value': str(event["battery_ok"]), 'Type': 'BIGINT'},
    {'Name': 'wind_max_mph', 'Value':str(event["wind_max_m_s"]*2.23694), 'Type':'DOUBLE'},
    {'Name': 'wind_avg_mph', 'Value':str(event["wind_avg_m_s"]*2.23694), 'Type':'DOUBLE'},
    {'Name': 'wind_dir_deg_corr', 'Value':str(event["wind_dir_deg"]+0), 'Type':'DOUBLE'},
    ]
    }, ]

I would be very grateful if anyone could shed light on this error :)

posta 4 anni fa2,9K visualizzazioni
1 Risposta
0

Hi, it looks like Timestream has detected a duplicate record with a different measure value type. This errors occurs when there are multiple records with the same dimensions, timestamps, and measure names but different measure values.

For more detail, please refer to the Timestream documentation on handling rejected errors: https://docs.aws.amazon.com/timestream/latest/developerguide/troubleshoot-rejectedrecords.html

AWS
con risposta 4 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.