Skip to content

Commit

Permalink
Added Hour time grain for MySQL (apache#615)
Browse files Browse the repository at this point in the history
  • Loading branch information
alanmcruickshank authored and mistercrunch committed Jun 15, 2016
1 parent ee2d333 commit b38590a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions caravel/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ def grains(self):
),
'mysql': (
Grain('Time Column', '{col}'),
Grain("hour", "DATE_ADD(DATE({col}), "
"INTERVAL HOUR({col}) HOUR)"),
Grain('day', 'DATE({col})'),
Grain("week", "DATE(DATE_SUB({col}, "
"INTERVAL DAYOFWEEK({col}) - 1 DAY))"),
Expand Down

0 comments on commit b38590a

Please sign in to comment.