Skip to content

Use emulator with bq command #354

Answered by totem3
joelmarty asked this question in Q&A
Discussion options

You must be logged in to vote

This might not be the best way, but it works for me by setting a dummy value to CLOUDSDK_AUTH_ACCESS_TOKEN.

root@3b728d515578:/# bq --api http://bigquery-emulator:9050 query --project_id my-project "select 1"
ERROR: (bq) You do not currently have an active account selected.
Please run:

  $ gcloud auth login

to obtain new credentials.

If you have already logged in with a different account, run:

  $ gcloud config set account ACCOUNT

to select an already authenticated account to use.
root@3b728d515578:/# CLOUDSDK_AUTH_ACCESS_TOKEN=dummy bq --api http://bigquery-emulator:9050 query --project_id my-project "select 1"
+-------+
| $col1 |
+-------+
|     1 |
+-------+

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joelmarty
Comment options

Answer selected by joelmarty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants