Bigquery ETL
Перейти к файлу
Alexander Nicholson a837866bc5
Skip views to stable tables and UDFs; Dynamically extract view refs (#2663)
2022-01-17 13:38:02 -05:00
.circleci Update Dockerfile 2022-01-12 16:35:13 +01:00
.github Add CODEOWNERS and restricted access datasets documentation (#2524) 2021-12-21 20:25:05 +00:00
.vscode Remove .vscode settings and add to gitignore (#1929) 2021-03-30 12:25:05 -04:00
bigquery_etl Added sql_generators script to create schema.yaml files for derived views (#2657) 2022-01-13 15:46:06 -05:00
dags Bug 1743493 Import pocket spoc tile ID data (#2661) 2022-01-14 14:53:40 -05:00
docs Add fivetran task docs 2022-01-11 11:23:32 -08:00
script Revert "adding 2m sleep for the export task to complete (#2609)" (#2660) 2022-01-14 12:54:10 -05:00
sql Bug 1743493 Import pocket spoc tile ID data (#2661) 2022-01-14 14:53:40 -05:00
sql_generators Skip views to stable tables and UDFs; Dynamically extract view refs (#2663) 2022-01-17 13:38:02 -05:00
stored_procedures Improvements for CRC32 stored procedure 2020-01-21 14:58:24 -08:00
tests Added sql_generators script to create schema.yaml files for derived views (#2657) 2022-01-13 15:46:06 -05:00
.bigqueryrc Create ~/.bigqueryrc without GCLOUD_SERVICE_KEY (#112) 2019-05-01 13:38:31 -07:00
.dockerignore Use zetasql to get dependencies for dag generation (#1817) 2021-02-18 17:49:46 -05:00
.eslintrc.yml Ran YAMLlint on all yaml files and resolved linting issues (fixes #1297) (#1481) 2020-10-29 17:24:55 -07:00
.flake8 Dryrun stored procedures (#1367) 2020-10-01 16:48:28 -04:00
.gitignore Remove .vscode settings and add to gitignore (#1929) 2021-03-30 12:25:05 -04:00
.isort.cfg Automatically sort python imports (#1840) 2021-02-24 17:11:52 -05:00
.pre-commit-config.yaml Add mypy to list of pre-commit hooks (#1995) 2021-05-04 09:32:25 -07:00
.yamllint.yaml Move search to sql_generators/ 2022-01-03 14:15:02 -08:00
CODEOWNERS Add CODEOWNERS and restricted access datasets documentation (#2524) 2021-12-21 20:25:05 +00:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md (#50) 2019-03-30 10:01:54 -07:00
CONTRIBUTING.md Add CODEOWNERS and restricted access datasets documentation (#2524) 2021-12-21 20:25:05 +00:00
Dockerfile Update Dockerfile 2022-01-12 16:35:13 +01:00
GRAVEYARD.md Remove asn_aggregates ETL (#2580) 2021-12-15 18:28:29 +00:00
LICENSE Add MPL license (#2353) 2021-09-20 17:59:47 +00:00
README.md Add links to advice for running with and without Rosetta (#2622) 2022-01-05 18:56:09 +00:00
bqetl Minor improvements to bqetl script (#2267) 2021-08-16 21:01:07 +00:00
conftest.py Automatically sort python imports (#1840) 2021-02-24 17:11:52 -05:00
dags.yaml Update impact tag and docs for bqetl_search_terms_daily (#2593) 2022-01-10 14:24:49 +00:00
java-requirements.in Bump pyjnius from 1.4.0 to 1.4.1 (#2470) 2021-11-01 20:46:51 +00:00
java-requirements.txt Bump pyjnius from 1.4.0 to 1.4.1 (#2470) 2021-11-01 20:46:51 +00:00
netlify.toml Install mkdocs via requirements files (#2528) 2021-11-26 18:12:39 +00:00
pom.xml Bump zetasql.version from 2021.03.2 to 2021.09.1 (#2347) 2021-09-20 18:49:34 +00:00
pytest.ini Use zetasql to find sql dependencies (#1802) 2021-02-17 11:48:40 -08:00
requirements.in Bump google-cloud-bigquery from 2.31.0 to 2.32.0 (#2659) 2022-01-14 17:05:55 +00:00
requirements.txt Bump google-cloud-bigquery from 2.31.0 to 2.32.0 (#2659) 2022-01-14 17:05:55 +00:00
setup.py Move DAG generation to CI 2022-01-07 14:25:04 -08:00

README.md

CircleCI

BigQuery ETL

This repository contains Mozilla Data Team's:

  • Derived ETL jobs that do not require a custom container
  • User-defined functions (UDFs)
  • Airflow DAGs for scheduled bigquery-etl queries
  • Tools for query & UDF deployment, management and scheduling

For more information, see https://mozilla.github.io/bigquery-etl/

Quick Start

Apple Silicon (M1) user suggestion

Enable Rosetta mode for your terminal BEFORE installing below tools using your terminal. It'll save you a lot of headaches. For tips on maintaining parallel stacks of python and homebrew running with and without Rosetta, see blog posts from Thinknum and Sixty North.

Pre-requisites

  • Homebrew (not required, but useful for Mac) - Follow the instructions here to install homebrew on your Mac.
  • Python 3.8+ - (see this guide for instructions if you're on a mac and haven't installed anything other than the default system Python).
  • Java JDK 11+ - (required for some functionality, e.g. AdoptOpenJDK) with $JAVA_HOME set.
  • Maven - (needed for downloading jar dependencies). Available via your package manager in most Linux distributions and from homebrew on mac, or you can install yourself by downloading a binary and following maven's install instructions.

GCP CLI tools

  • For Mozilla Employees or Contributors (not in Data Engineering) - Set up GCP command line tools, as described on docs.telemetry.mozilla.org. Note that some functionality (e.g. writing UDFs or backfilling queries) may not be allowed.
  • For Data Engineering - In addition to setting up the command line tools, you will want to log in to shared-prod if making changes to production systems. Run gcloud auth login --update-adc --project=moz-fx-data-shared-prod (if you have not run it previously).

Installing bqetl

  1. Clone the repository
git clone git@github.com:mozilla/bigquery-etl.git
cd bigquery-etl
  1. Install the bqetl command line tool
./bqetl bootstrap
  1. Install standard pre-commit hooks
venv/bin/pre-commit install
  1. Download java dependencies
mvn dependency:copy-dependencies
venv/bin/pip-sync requirements.txt java-requirements.txt

Finally, if you are using Visual Studio Code, you may also wish to use our recommended defaults:

cp .vscode/settings.json.default .vscode/settings.json

And you should now be set up to start working in the repo! The easiest way to do this is for many tasks is to use bqetl. You may also want to read up on common workflows.