Skip to main content

Query runner for BigQuery. It automatically analyzes dependencies and runs only necessary queries in parallel.

Project description

bqrun

概要

ディレクトリの中にあるsqlファイルを全て読み、依存関係を解析し(あるファイルAでselect .. fromされているテーブルが別のファイルBでcreate tableされていた場合、 BはAより前に実行される)、順番に実行するためのMakefileを作成、makeを実行する。

外部依存

  1. docker
  2. graphviz(dotコマンド)

インストール

  1. pip install bqrun

前提

  1. 1つのディレクトリの中に全てのSQLファイルが入っていること
  2. 全てのSQLファイルは拡張子.sqlを持つこと、かつ、クエリ以外に.sqlで終わるファイルがないこと

大まかな動作

  1. 全SQLファイルを読んで依存関係を解析、依存関係に従ったMakefileを作成する
  2. このMakefileにより、各ファイルに対し以下のようなコマンドが実行される
    1. 各SQLファイルをbq queryに投げる
    2. done.<base name> というファイルを作成する(<base name>は、ファイル名の拡張子以外)
  3. 2回目以降の実行では、各ファイルについてdone.<base name>ファイルのタイムスタンプと、依存先のファイルのタイムスタンプを比較し再実行が必要な部分だけが実行される

オプション

  1. -p=<num>または--parallel=<num>: 並列実行数を指定(デフォルトは8)

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

bqrun-2.0.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

bqrun-2.0.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file bqrun-2.0.1.tar.gz.

File metadata

  • Download URL: bqrun-2.0.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.8.0-1038-gcp

File hashes

Hashes for bqrun-2.0.1.tar.gz
Algorithm Hash digest
SHA256 cc912d664c06fe9c3d2d75439989a1f570a36cba6c55eaa65d005acf4afcc164
MD5 0ed15560a738c9396b52bf375ef6a558
BLAKE2b-256 82db1fa8d710c4a581aa08ae1ba7f3c55cc48be2d5d2ef9bf65c832595b60bb5

See more details on using hashes here.

File details

Details for the file bqrun-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: bqrun-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Linux/5.8.0-1038-gcp

File hashes

Hashes for bqrun-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 081ae6700ab1ee52ca2db49f281fb176b696ad5d30e04d3b43cf941085349543
MD5 bd4c67133c8ea1228002b1e2fd706562
BLAKE2b-256 e864168c44689f5e3940019099c170fe8b3c4989672a321f4ba6f4033e5ec544

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