Let’s find out more about Google Cloud BigQuery Emulator in this article. At Bobcares, with our Google Cloud Platform Support Services, we can handle your GCP emulator issues.
Google Cloud BigQuery Emulator
We can test the application using the local, in-memory emulator that is provided by the Google Cloud CLI. The emulator will not persist data across runs because it only stores data in memory. Not for production deployments, it is meant to assist the user in using Bigtable for local development and testing.
We can start a BigQuery server on the local workstation with this emulator. We can use it for testing and development. It is written in the Go language. The emulator can be a static single binary and run independently. So, by giving the address of the new emulator, we can use the emulator from programs built in non-Go languages or from the bq
command.
It stores data in SQLite. At startup, we can choose between memory and files as the data storage location. Files allow us to persist data. We can load seeds from a YAML file on startup. If the Go programming language is available, we can use the httptest
to launch an emulator on the same process as the testing process.
How to install it?
Firstly, we make sure the Go is installed. Then install the latest version with the below command.
$ go install github.com/goccy/bigquery-emulator/cmd/bigquery-emulator@latest
Starting Stand-alone Server
We can start it using the below options:
$ ./bigquery-emulator -h Usage: bigquery-emulator [OPTIONS] Application Options: --project= specify the project name --dataset= specify the dataset name --port= specify the port number (default: 9050) --log-level= specify the log level (debug/info/warn/error) (default: error) --log-format= sepcify the log format (console/json) (default: console) --database= specify the database file if required. if not specified, it will be on memory --data-from-yaml= specify the path to the YAML file that contains the initial data -v, --version print version Help Options: -h, --help Show this help message
Then start the server using the project name.
$ ./bigquery-emulator --project=test [bigquery-emulator] listening at 0.0.0.0:9050
If we want to launch an emulator using a docker image, use the below code:
$ docker run -it ghcr.io/goccy/bigquery-emulator:latest --project=test
[Looking for a solution to another query? We are just a click away.]
Conclusion
The article provides a brief description of Google Cloud BigQuery Emulator along with its installation code and initializing process described by our Tech team.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments