Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 37 additions & 102 deletions .github/workflows/_extension_distribution.yml

Large diffs are not rendered by default.

37 changes: 4 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
> **IMPORTANT**:
> This extension is a fork of the community [DuckDB BigQuery](https://github.com/hafenkran/duckdb-bigquery) extension. It is not meant at being deployed to the community extension repository but aimed at being used for internal purposes.

# DuckDB BigQuery Extension

This community extension allows [DuckDB](https://duckdb.org) to query data from Google BigQuery using a mix of BigQuery Storage (Read/Write) and REST API. It enables users to access, manage, and manipulate their BigQuery datasets/tables directly from DuckDB using standard SQL queries. Inspired by official DuckDB RDBMS extensions like [MySQL](https://duckdb.org/docs/extensions/mysql.html), [PostgreSQL](https://github.com/duckdb/postgres_scanner), and [SQLite](https://github.com/duckdb/sqlite_scanner), this extension offers a similar feel. See [Important Notes](#important-notes-on-using-google-bigquery) for disclaimers and usage information.
Expand Down Expand Up @@ -528,11 +531,7 @@ docker run \

## Testing

The extension includes two test suites designed for different testing scenarios:

### Testing Against Real BigQuery

The `test/sql/bigquery/` directory contains tests that run against a real Google BigQuery project. These tests verify the extension's behavior with the actual BigQuery API.
The `test/sql/` directory contains tests that run against a real Google BigQuery project. These tests verify the extension's behavior with the actual BigQuery API.

**Prerequisites:**

Expand Down Expand Up @@ -563,34 +562,6 @@ BQ_TEST_DATASET=your-dataset \
- `BQ_TEST_DATASET`: A test dataset in your project (will be used for read/write operations)
- `BQ_SERVICE_ACCOUNT_JSON`: Full JSON content for secret authentication tests

### Testing Against BigQuery Emulator

The `test/sql/local/` directory contains tests that run against the [BigQuery Emulator](https://github.com/goccy/bigquery-emulator), a local BigQuery-compatible server. These tests are ideal for CI/CD pipelines and development without incurring BigQuery costs.

```bash
# Start the emulator
./bigquery-emulator --project=test --dataset=dataset1
```

**Running Emulator Tests:**

```bash
BQ_API_ENDPOINT=0.0.0.0:9050 \
BQ_GRPC_ENDPOINT=0.0.0.0:9060 \
./build/release/test/unittest 'test/sql/local/*.test'

# Run a specific local test
BQ_API_ENDPOINT=0.0.0.0:9050 \
BQ_GRPC_ENDPOINT=0.0.0.0:9060 \
./build/release/test/unittest 'test/sql/local/attach_insert_table.test'
```

**Limitations:**

- The emulator may not support all BigQuery features
- Some advanced SQL functions might behave differently
- Performance characteristics will differ from production BigQuery

## Important Notes on Using Google BigQuery

> **⚠️ Disclaimer**: This is an independent, community-maintained open-source project and is not affiliated with, endorsed by, or officially supported by Google LLC, or any of their subsidiaries. This extension is provided "as is" without any warranties or guarantees. "DuckDB" and "BigQuery" are trademarks of their respective owners. Users are solely responsible for compliance with applicable terms of service and any costs incurred through usage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_debug_show_queries=True;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ require-env BQ_TEST_BILLING_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET} billing_project=${BQ_TEST_BILLING_PROJECT}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_experimental_enable_bigquery_options=TRUE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_debug_show_queries=true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_use_legacy_scan=true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ require-env BQ_TEST_BILLING_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

query I
SELECT COUNT(*) FROM bigquery_scan('bigquery-public-data.geo_us_boundaries.cnecta', billing_project=${BQ_TEST_BILLING_PROJECT});
----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_bignumeric_as_varchar=TRUE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
2 changes: 0 additions & 2 deletions test/sql/bigquery/auth_env.test → test/sql/auth_env.test
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SELECT * FROM bigquery_execute('${BQ_TEST_PROJECT}', 'DROP TABLE IF EXISTS `${BQ_TEST_PROJECT}.${BQ_TEST_DATASET}.exec_table`')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_debug_show_queries = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ require-env BQ_TEST_BILLING_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
SET bq_debug_show_queries = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

statement ok
ATTACH 'project=${BQ_TEST_PROJECT} dataset=${BQ_TEST_DATASET}' AS bq (TYPE bigquery);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ require-env BQ_TEST_PROJECT

require-env BQ_TEST_DATASET

require-env GOOGLE_APPLICATION_CREDENTIALS

# Create a simple table with GEOGRAPHY columns using bigquery_execute
statement ok
FROM bigquery_execute('${BQ_TEST_PROJECT}', '
Expand Down
42 changes: 0 additions & 42 deletions test/sql/local/attach_clear_cache.test

This file was deleted.

24 changes: 0 additions & 24 deletions test/sql/local/attach_create_if_exists.test

This file was deleted.

17 changes: 0 additions & 17 deletions test/sql/local/attach_database_size.test

This file was deleted.

Loading
Loading