From 141dc12e445f5a1bbaa720b988b135b01d329789 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 23 Jun 2016 16:59:10 -0700 Subject: [PATCH] Adding quarter time grain for Presto --- caravel/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/caravel/models.py b/caravel/models.py index 5396356aebaf8..db04e39cd2622 100644 --- a/caravel/models.py +++ b/caravel/models.py @@ -406,6 +406,7 @@ def grains(self): Grain('Time Column', _('Time Column'), '{col}'), Grain('week', _('week'), "date_trunc('week', CAST({col} AS DATE))"), Grain('month', _('month'), "date_trunc('month', CAST({col} AS DATE))"), + Grain('quarter', _('quarter'), "date_trunc('quarter', CAST({col} AS DATE))"), Grain("week_ending_saturday", _('week_ending_saturday'), "date_add('day', 5, " "date_trunc('week', date_add('day', 1, CAST({col} AS DATE))))"), Grain("week_start_sunday", _('week_start_sunday'), "date_add('day', -1, "