Solved

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

  • 14 June 2023
  • 3 replies
  • 47 views

Userlevel 2
Badge

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

 

 

icon

Best answer by Dilini Fernando 6 July 2023, 09:32

View original

3 replies

Userlevel 3
Badge

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

Userlevel 4
Badge +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 

Userlevel 4
Badge +2

Hi @Chris Selph,

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

Best regards,
Dilini

Reply