Skip to main content

BigQuery Foreign Data Wrapper for PostgreSQL

Project description

Pypi Build Status codecov MIT licensed

bigquery_fdw is a BigQuery foreign data wrapper for PostgreSQL using Multicorn.

It allows to write queries in PostgreSQL SQL syntax using a foreign table. It supports most of BigQuery’s data types and operators.

Features and limitations

Read more.

Requirements

  • PostgreSQL >= 9.5

  • Python 3

Get started

Using docker

See getting started with Docker

Installation on Debian/Ubuntu

Dependencies required to install bigquery_fdw:

You need to install the following dependencies:

# Install required packages
apt-get update
apt-get install --yes postgresql-server-dev-12 python3-setuptools python3-dev make gcc git

For PostgresSQL 9.X, install postgresql-server-dev-9.X instead of postgresql-server-dev-12.

Installation

# Install Multicorn
git clone git://github.com/Kozea/Multicorn.git && cd Multicorn
export PYTHON_OVERRIDE=python3
make && make install

# Install bigquery_fdw
pip3 install bigquery-fdw

Major dependencies installed automatically during the installation process:

Usage

We recommend testing the BigQuery client connectivity before trying to use the FDW.

With psql:

CREATE EXTENSION multicorn;

CREATE SERVER bigquery_srv FOREIGN DATA WRAPPER multicorn
OPTIONS (
    wrapper 'bigquery_fdw.fdw.ConstantForeignDataWrapper'
);

CREATE FOREIGN TABLE my_bigquery_table (
    column1 text,
    column2 bigint
) SERVER bigquery_srv
OPTIONS (
    fdw_dataset  'my_dataset',
    fdw_table 'my_table',
    fdw_key '/opt/bigquery_fdw/key.json'
);

Options

List of options implemented in CREATE FOREIGN TABLE syntax:

Option

Default

Description

fdw_dataset

BigQuery dataset name

fdw_table

BigQuery table name

fdw_key

Path to private Json key (See Key storage rec ommendations)

fdw_convert_tz

Convert BigQuery time zone for dates and timestamps to selected time zone. Example: 'US/Eastern'.

fdw_group

'false'

See Remote grouping and counting.

fdw_casting

See Casting.

fdw_verbose

'false'

Set to 'true' to output debug information in PostrgeSQL’s logs

fdw_sql_dialect

'standard'

BigQuery SQL dialect. Currently only standard is supported.

More documentation

See bigquery_fdw documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bigquery-fdw-1.6.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

bigquery_fdw-1.6-py2.py3-none-any.whl (10.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file bigquery-fdw-1.6.tar.gz.

File metadata

  • Download URL: bigquery-fdw-1.6.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

File hashes

Hashes for bigquery-fdw-1.6.tar.gz
Algorithm Hash digest
SHA256 9182ae9c0f99baf044ea3c38ab7acb35c6602c91f1fabe7698684d326ab69332
MD5 28581b2f35aa0b7c3458c7f14b80e519
BLAKE2b-256 8ad5ccaec5c9b63b13b96a0e10148c1f8391ac987151f3d4b847f5e757620dac

See more details on using hashes here.

File details

Details for the file bigquery_fdw-1.6-py2.py3-none-any.whl.

File metadata

  • Download URL: bigquery_fdw-1.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

File hashes

Hashes for bigquery_fdw-1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 96bcc21a3804f7a647fd9af1d41fdd9ef924b4cc583a5dae2358cee617caeaf0
MD5 9efa05472013a861fef9339ba928c517
BLAKE2b-256 a619cf8c00e5cb5c49affbcd72f7ab5d376f661f3e9610d3047592ac1e94ed01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page