简体   繁体   中英

GCP BigQuery - Verify successful execution of stored procedure

I have a BigQuery routine that inserts records into a BQ Table. I am looking to have a Eventarc trigger that triggers Cloud Run, and performs some action on successful execution of the BigQuery Routine.

From Cloud Logging, I can see two events that would seem to confirm the successful execution of the BQ Routine. protoPayload.methodName="google.cloud.bigquery.v2.JobService.InsertJob"

protoPayload.metadata.tableDataChange.insertedRowsCount

However, this does not give me the Job ID.

So, I am looking at event -
protoPayload.methodName="jobservice.jobcompleted"

Would it be correct to assume that, if protoPayload.serviceData.jobCompletedEvent.job.jobStatus.error is empty, then the stored procedure execution was successful?

Thanks!

Decided to go with protoPayload.methodName="jobservice.jobcompleted" in this case. It gives the job id at protoPayload.requestMetadata.resourceName , status like protoPayload.serviceData.jobCompletedEvent.job.jobStatus.state and errors if any like protoPayload.serviceData.jobCompletedEvent.job.jobStatus.error

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM