Skip to main content
Answer

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

  • June 14, 2023
  • 3 replies
  • 80 views

Chris Selph
Practitioner
Forum|alt.badge.img

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

 

 

Best answer by Dilini Fernando

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
Forum|alt.badge.img+1

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
Seasoned Practitioner
Forum|alt.badge.img+2

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
Seasoned Practitioner
Forum|alt.badge.img+2
  • Seasoned Practitioner
  • Answer
  • July 6, 2023

Hi @Chris Selph,

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

Best regards,
Dilini