跳至內容

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 :)

已提問 4 年前檢視次數 2854 次
1 個回答
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
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。