Last active
February 8, 2019 06:48
-
-
Save seahrh/bba9537eabe147de3c25219112e0fe30 to your computer and use it in GitHub Desktop.
Loop dictionary in airflow jinja template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for k, v in params.lifecycle_days.items() %} | |
alter table {{ k }} drop if exists partition (ds<'{{ macros.ds_format(macros.ds_add(ds, v*-1), "%Y-%m-%d", "%Y%m%d") }}'); | |
{% endfor %} | |
{% for k, v in params.lifecycle_days.items() %} | |
analyze table {{ k }} partition (ds='{{ ds_nodash }}') compute statistics; | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment