Skip to content

Conversation

@alvarowolfx
Copy link
Contributor

Split job polling logic, so later we can have a generic job vs query package to help execute and wait for jobs.

Towards #12877

@alvarowolfx alvarowolfx requested review from a team as code owners September 29, 2025 17:43
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the BigQuery API. label Sep 29, 2025
Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still digesting the pattern a bit here.

}

// CreateFunc is a function that start/insert a new job in BigQuery. Usually jobs.insert or jobs.query.
type CreateFunc = func(ctx context.Context, opts []gax.CallOption) (protoreflect.Message, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CreateFunc and WaitFunc are the same type signature. Should you just use a more general type and name (e.g. RPCFunc or something)?

q.consumeQueryResponse(&bigquerypb.GetQueryResultsResponse{
JobReference: res.GetJobReference(),
})
func (q *Query) insertQueryFunc(job *bigquerypb.Job, projectID string, opts []gax.CallOption) internaljob.CreateFunc {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels odd to have this method hanging off the outer message and the inner field referencing it as part of its constructor. I wonder if we're missing a chance for a better signature for the new handler function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants