Last active
February 6, 2018 16:59
-
-
Save robert8138/9ebe45a8b726702b4c6ac43df8f736f0 to your computer and use it in GitHub Desktop.
An example of dynamic partitions
This file contains 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
INSERT OVERWRITE TABLE bookings_summary PARTITION (ds) | |
SELECT | |
dim_market | |
, SUM(m_bookings) AS m_bookings | |
, ds # For Hive to know we are using dynamic partitions | |
FROM | |
fct_bookings | |
WHERE | |
ds BETWEEN '{{ earliest_ds }}' AND '{{ latest_ds }}' | |
GROUP BY | |
dim_market | |
, ds | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment