Skip to main content
Chris Selph
Practitioner ⭐️⭐️⭐️
Practitioner ⭐️⭐️⭐️
Jun 14, 2023 4:01 PM UTC
Solved

Transformation failure: failed with status 400: Event id not found.

Executing transform from Raw/Staging to Dataset Events. 

Code

select
cast(`uniqueid` as BIGINT) as id,
cast(`Start Time` as TIMESTAMP) as startTime,
cast(`End Time` as TIMESTAMP) as endTime,
1626362640169782 as dataSetId,
concat("Chem-Batch", "-", Unit, "-", `Batch ID`) as description,
'Process' as type,
'Batch' as subtype
from
`Chem-Batch`.`Batch-Unit`

where `Start Time` > '2023-06-13'

Preview shows expected 3 row results:

 

Run yields this error:

Request with id 90f5d941-7f0e-9553-9ca5-317d784434d1 to https://az-eastus-1.cognitedata.com/api/v1/projects/ra-istc-sandbox/events/update failed with status 400: Event id not found. Missing ids: [48, 49].

It seems all columns data in Raw rows has appropriate data.

Any ideas are welcome.

Chris

 

 

    Dilini Fernando
    Expert ⭐️⭐️⭐️⭐️
    Jul 6, 2023 7:32 AM UTC

    Hi @Chris Selph,

    As of now, I will close this thread. Let us know if you have more questions.

    Best regards,
    Dilini

    3 replies

    Gaetan  Helness
    MVP ⭐️⭐️⭐️⭐️⭐️
    MVP ⭐️⭐️⭐️⭐️⭐️
    Jun 21, 2023 6:20 PM UTC

    Hi Chris,

    Sorry for the late reply. 

    Are you trying to create or update events? 

    When specifying the id, since it is an auto-generated field, the action is going to be UPDATE only, as you see in the endpoint. 

    The error message mentions that when trying to update, those events were not found, they will not be created though since id cannot be used for creation (only external_id)

    If you want to update only existing events and avoid error, you can do on join on _cdf.events table, which contains existing CDF events

    Dilini Fernando
    Expert ⭐️⭐️⭐️⭐️
    Expert ⭐️⭐️⭐️⭐️
    Jun 29, 2023 6:22 AM UTC

    Hi @Chris Selph,

    I hope Gaetan’s reply helped you. If you have more questions, please feel free to post here.

    Best regards,
    Dilini 

    Dilini Fernando
    Expert ⭐️⭐️⭐️⭐️
    Expert ⭐️⭐️⭐️⭐️
    Jul 6, 2023 7:32 AM UTC

    Hi @Chris Selph,

    As of now, I will close this thread. Let us know if you have more questions.

    Best regards,
    Dilini