Passer au contenu

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

demandé il y a 4 ans2,9 k vues

1 réponse
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

répondu il y a 4 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.