Skip to content

please support customized jobId in BigQuery jobReference #2121

Description

@c0b

from #2107 (comment)

for better management of different jobs, to use a customized jobid is also something needed, from listJobs I can get the jobId(s) look like these, I can see bqjob_ are from bq command line, bquijob_ are from bigqueryUI, I want all queries from my nodejs app to start with some special naming pattern,

job_ZhgN2K65s_XT1Yq7ooMJhG0TGcQ
job_xAN6iV-dcfb1XnCbpHkOdJ542JY
bquijob_74a81cc0_15aea476e69
bquijob_3c27ca25_15aea468ab4
bquijob_50d0e7e0_15aea45b2dc
job_qGBPt_F45gotmov1sdKobAgTEjk
job_gqUriVZhciWVHrSokbQ2AGIkGXo
job_oRykICSs6Tc7gm4dOQdt3nyQSpc
bqjob_r1f987f469a3e2a33_0000015
bqjob_r56059b08bb57b6ee_0000015

from the REST Reference, both sync and async job can start query with a specified jobReference with customized jobId
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs

I have tried put a jobReference object on the startQuery but it seems ignored?

  // jobReference need to be on top level of POST body object for job insert REST API
  jobReference: {
    projectId: 'my-project',
    jobId: 'myjob_' + Date.now().toString(36) + '_' + Math.random().toString(36).substr(2),
  },

Metadata

Metadata

Labels

api: bigqueryIssues related to the BigQuery API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions