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を実行する。
外部依存
- docker
- graphviz(dotコマンド)
インストール
pip install bqrun
前提
- 1つのディレクトリの中に全てのSQLファイルが入っていること
- 全てのSQLファイルは拡張子
.sqlを持つこと、かつ、クエリ以外に.sqlで終わるファイルがないこと
大まかな動作
- 全SQLファイルを読んで依存関係を解析、依存関係に従ったMakefileを作成する
- このMakefileにより、各ファイルに対し以下のようなコマンドが実行される
- 各SQLファイルを
bq queryに投げる done.<base name>というファイルを作成する(<base name>は、ファイル名の拡張子以外)
- 各SQLファイルを
- 2回目以降の実行では、各ファイルについて
done.<base name>ファイルのタイムスタンプと、依存先のファイルのタイムスタンプを比較し再実行が必要な部分だけが実行される
オプション
-p=<num>または--parallel=<num>: 並列実行数を指定(デフォルトは8)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bqrun-3.0.0.tar.gz
(6.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
bqrun-3.0.0-py3-none-any.whl
(6.8 kB
view details)
File details
Details for the file bqrun-3.0.0.tar.gz.
File metadata
- Download URL: bqrun-3.0.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b82854cae9bfb381595c82101872cbe05a9ed70cf1e6fc1496834d87dd3939a5
|
|
| MD5 |
19fa589a3de50da77c3ccab4f5a22a88
|
|
| BLAKE2b-256 |
5aca046595be500049e4dfed9fc58c83d046d6f8bd517b821b3f37294d04b5a7
|
File details
Details for the file bqrun-3.0.0-py3-none-any.whl.
File metadata
- Download URL: bqrun-3.0.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4842bbf1884e187d4537a9a98933e96ed8fd56ee8b6e57f3c84b17d862c97217
|
|
| MD5 |
696061a38d1fcd31f276ed1a8e28721d
|
|
| BLAKE2b-256 |
dd99bab92baaabbb02bf3660c406ae37f6cd37ec2e436280b4ec51cee1c82060
|