내용으로 건너뛰기

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

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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠