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

Dependencies

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-10 python3-setuptools python3-dev make gcc git

# Install pip3
easy_install3 pip

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

Major dependencies installed automatically during the installation process:

Installation

# Install `setuptools` if necessary
pip3 install --upgrade setuptools

# 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

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 recommendations <do cs/key_storage.md> __)

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.4.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

bigquery_fdw-1.4-py2.py3-none-any.whl (12.4 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: bigquery-fdw-1.4.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bigquery-fdw-1.4.tar.gz
Algorithm Hash digest
SHA256 ab25d5caaff41bd020e36c9effb1f3db7390fb074c074c866e23ed0f14a32101
MD5 e245220bf92ea819d1f86f90913a6b18
BLAKE2b-256 d452019ab3017c19cd1739dd596101819ec6d400fc72cf660464a628da742c9e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bigquery_fdw-1.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 61c344b10124745c7cf91b159acac61f60621b26a55c4506faf7f870765a0b3e
MD5 273733319267eab9b83695b9c3580785
BLAKE2b-256 b4d24d81c95fc81aede4fcda0fe340fb74dee2536ce9d9d62796f2d7fc42f21f

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