Comments (3)
Hi @ambujs-ps, this has worked for me (using Test Containers):
// Build the container
var container = new ContainerBuilder()
.WithImage("ghcr.io/goccy/bigquery-emulator:latest")
.WithPortBinding(9050, true)
.WithResourceMapping(new FileInfo("data.yaml"), "/srv/testdata/")
.WithCommand("--project=test", "--data-from-yaml=/srv/testdata/data.yaml")
.WithWaitStrategy(Wait.ForUnixContainer().UntilPortIsAvailable(9050))
.Build();
// Start the container.
await container
.StartAsync()
.ConfigureAwait(false);
// Build the BigQuery Client
var bigQueryEndpoint = new UriBuilder(Uri.UriSchemeHttp, container.Hostname, container.GetMappedPublicPort(9050)).Uri;
var client = await new BigQueryClientBuilder {
ProjectId = /* your project Id **/,
ApiKey = "fake",
BaseUri = bigQueryEndpoint.ToString()
}.BuildAsync();
from bigquery-emulator.
BigQueryClientBuilder
Thanks so much!, I'll give this a try.
from bigquery-emulator.
FYI a key part is providing a fake ApiKey
to Google's BigQueryClientBuilder
. Even if the BaseUri
is pointing to a containerized emulator instance, you may still have problems - if you provide a null
credential then the Client will look for the Application Default Credentials file, if you provide even a fake User credential from JSON or a file then the Client will attempt to refresh the auth token.
from bigquery-emulator.
Related Issues (20)
- Cant parametrize FLOAT value in query HOT 9
- `Too many SQL variables` when inserting data HOT 2
- When names of tables start with same string, _TABLE_SUFFIX expansion may fail
- Using JobId (in Java) when querying, causes 'no such table' error to be returned
- Replace SQLite with DuckDB
- Unmarshal fails to a struct with time.Time type when using the cloud.google.com/go/bigquery library HOT 5
- Queries on TIMESTAMP columns are not handled correctly when no timezone is specified HOT 1
- failed to add query result to dynamic destination table (on a simple query) HOT 4
- How to install and run this project locally on my computer? HOT 6
- JSON_EXTRACT_SCALAR nor JSON_QUERY does not work as expected HOT 1
- Connection error when creating a dataset HOT 8
- Does the emulator work with Pandas GBQ? HOT 3
- Error when executing bq command from google-cloud-cli version 469.0.0
- Response from table update is incompatible with Google's Python SDK HOT 1
- Improve emulator performance for large projects HOT 7
- Failes to exec merge statement UPDATE
- Cannot create a view with a query that ends in semicolon
- Cannot materialize job results when table does not yet exist
- [Golang] Errors from zetasql parser HOT 3
- The BigQuery emulator doesn't support CREATE TABLE AS SELECT with column definition list HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bigquery-emulator.