跳至内容

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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。