diff --git a/caravel/db_engine_specs.py b/caravel/db_engine_specs.py index c2175eb6e14cf..9c73934ebd1ad 100644 --- a/caravel/db_engine_specs.py +++ b/caravel/db_engine_specs.py @@ -127,6 +127,10 @@ class MySQLEngineSpec(BaseEngineSpec): "INTERVAL DAYOFWEEK({col}) - 1 DAY))"), Grain("month", _('month'), "DATE(DATE_SUB({col}, " "INTERVAL DAYOFMONTH({col}) - 1 DAY))"), + Grain("quarter", _('quarter'), "MAKEDATE(YEAR({col}), 1) " + "+ INTERVAL QUARTER({col}) QUARTER - INTERVAL 1 QUARTER"), + Grain("year", _('year'), "DATE(DATE_SUB({col}, " + "INTERVAL DAYOFYEAR({col}) - 1 DAY))"), ) @classmethod