Skip to content

Instantly share code, notes, and snippets.

View mistercrunch's full-sized avatar

Maxime Beauchemin mistercrunch

View GitHub Profile
SELECT generate_aggregate_2_filters( 'video_views_102384', '2016-06-01 00:00:00', '{ ds }' ,'viewer_application_name','viewer_os_version');
should be
SELECT generate_aggregate_2_filters( 'video_views_102384', '2016-06-01 00:00:00', ds ,'viewer_application_name','viewer_os_version');
def stage_check_exchange(
task_id_prefix,
hql_stage,
sql_check,
exchange_statement,
default_args):
'''
Used to abstract the common pattern of:
* loading into a staging
* performing data quality checks
@mistercrunch
mistercrunch / gist:91d90ab05af77c76e1f9
Created June 15, 2015 19:27
Airflow plugin example
from airflow.hooks.base_hook import BaseHook
from airflow.models import BaseOperator
from airflow.executors.base_executor import BaseExecutor
from airflow import AirflowViewPlugin, AirflowMacroPlugin
from flask_admin import expose
class PluginHook(BaseHook):
pass
class PluginOperator(BaseOperator):
@mistercrunch
mistercrunch / vimrc
Last active July 29, 2016 21:06
vimrc
filetype plugin indent on
set colorcolumn=80
set nobackup
set nowritebackup
set noswapfile
set tabstop=4
set shiftwidth=4
set expandtab
set softtabstop=4
set autoindent
name economy (mpg) cylinders displacement (cc) power (hp) weight (lb) 0-60 mph (s) year
AMC Ambassador Brougham 13 8 360 175 3821 11 73
AMC Ambassador DPL 15 8 390 190 3850 8.5 70
AMC Ambassador SST 17 8 304 150 3672 11.5 72
AMC Concord DL 6 20.2 6 232 90 3265 18.2 79
AMC Concord DL 18.1 6 258 120 3410 15.1 78
AMC Concord DL 23 4 151 3035 20.5 82
AMC Concord 19.4 6 232 90 3210 17.2 78
AMC Concord 24.3 4 151 90 3003 20.1 80
AMC Gremlin 18 6 232 100 2789 15 73