All Projects → gabfl → bigquery_fdw

gabfl / bigquery_fdw

Licence: MIT License
BigQuery Foreign Data Wrapper for PostgreSQL

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to bigquery fdw

PLSwift
PostgreSQL Functions in Swift
Stars: ✭ 39 (-40%)
Mutual labels:  postgresql-extension
supautils
PostgreSQL extension that prevents doing ALTER/DROP/GRANT on a set of reserved roles.
Stars: ✭ 21 (-67.69%)
Mutual labels:  postgresql-extension
bigquery-geo-viz
Visualize Google BigQuery geospatial data using Google Maps Platform APIs
Stars: ✭ 68 (+4.62%)
Mutual labels:  bigquery
django-ltree
An ltree extension implementation to support hierarchical tree-like data using the native Postgres extension ltree in django models
Stars: ✭ 48 (-26.15%)
Mutual labels:  postgresql-extension
pg-audit-json
Simple, easily customised trigger-based auditing for PostgreSQL (Postgres). See also pgaudit.
Stars: ✭ 34 (-47.69%)
Mutual labels:  postgresql-extension
gcp-ml
Google Cloud Platform Machine Learning Samples
Stars: ✭ 31 (-52.31%)
Mutual labels:  bigquery
argon
Campaign Manager 360 and Display & Video 360 Reports to BigQuery connector
Stars: ✭ 31 (-52.31%)
Mutual labels:  bigquery
pre-commit-dbt
🎣 List of `pre-commit` hooks to ensure the quality of your `dbt` projects.
Stars: ✭ 149 (+129.23%)
Mutual labels:  bigquery
astro
Astro allows rapid and clean development of {Extract, Load, Transform} workflows using Python and SQL, powered by Apache Airflow.
Stars: ✭ 79 (+21.54%)
Mutual labels:  bigquery
carto-spatial-extension
A set of UDFs and Procedures to extend BigQuery, Snowflake, Redshift and Postgres with Spatial Analytics capabilities
Stars: ✭ 131 (+101.54%)
Mutual labels:  bigquery
kuromoji-for-bigquery
Tokenize Japanese text on BigQuery with Kuromoji in Apache Beam/Google Dataflow at scale
Stars: ✭ 11 (-83.08%)
Mutual labels:  bigquery
bqv
The simplest tool to manage views of BigQuery.
Stars: ✭ 22 (-66.15%)
Mutual labels:  bigquery
target-and-market
A data-driven tool to identify the best candidates for a marketing campaign and optimize it.
Stars: ✭ 19 (-70.77%)
Mutual labels:  bigquery
dbt-ml-preprocessing
A SQL port of python's scikit-learn preprocessing module, provided as cross-database dbt macros.
Stars: ✭ 128 (+96.92%)
Mutual labels:  bigquery
ptrack
Block-level incremental backup engine for PostgreSQL
Stars: ✭ 21 (-67.69%)
Mutual labels:  postgresql-extension
go-bqloader
bqloader is a simple ETL framework to load data from Cloud Storage into BigQuery.
Stars: ✭ 16 (-75.38%)
Mutual labels:  bigquery
airflow-tutorial
Use Airflow to move data from multiple MySQL databases to BigQuery
Stars: ✭ 96 (+47.69%)
Mutual labels:  bigquery
laravel-big
Google BigQuery for Laravel
Stars: ✭ 14 (-78.46%)
Mutual labels:  bigquery
BQconvert
BigQuery Schema Conversion Tool
Stars: ✭ 20 (-69.23%)
Mutual labels:  bigquery
dbq
CLI tool to easily Decorate BigQuery table name
Stars: ✭ 13 (-80%)
Mutual labels:  bigquery

bigquery_fdw: BigQuery Foreign Data Wrapper for PostgreSQL

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 up to 12
  • Python >= 3.4

Currently, PostgreSQL 13 and 14 are unsupported by the dependency Multicorn (see here and here). Some forks of Multicorn seem to add support for these versions and are referenced in the GitHub issues linked.

⚠️ Migrating to version 1.8 from versions 1.7 and below

Starting with version 1.8, the fdw_key option is deprecated and replaced with a default environment variable. See Authentication.

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.

All PostgreSQL versions from 9.2 to 12 should be supported. Building Multicorn against PostgreSQL 13 is currently not working properly (as of 1/21/2013).

Installation

# Install Multicorn
# gabfl/Multicorn is a fork of Segfault-Inc/Multicorn that adds better support for Python3.
# You may chose to build against the original project instead.
git clone git://github.com/gabfl/Multicorn.git && cd Multicorn
make && make install

# Install bigquery_fdw
pip3 install bigquery-fdw

Major dependencies installed automatically during the installation process:

Authentication

bigquery_fdw relies on Google Cloud API's default authentication.

Your need to have an environment variable GOOGLE_APPLICATION_CREDENTIALS that has to be accessible by bigquery_fdw. Setting environment variables varies depending on OS but for Ubuntu or Debian, the preferred way is to edit /etc/postgresql/[version]/main/environment and add:

GOOGLE_APPLICATION_CREDENTIALS = '/path/to/key.json'

Restarting PostgreSQL is required for the environment variable to be loaded.

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'
);

Options

List of options implemented in CREATE FOREIGN TABLE syntax:

Option Default Description
fdw_dataset - BigQuery dataset name
fdw_table - BigQuery table name
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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].