From 73daf2f8d1a22956688f2564f7ab18aaae6e7c1a Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 16 Mar 2016 16:42:35 -0700 Subject: [PATCH] [hotfix] casting dates for presto grain functions --- panoramix/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panoramix/models.py b/panoramix/models.py index 05f4a670dae9c..367c437476286 100644 --- a/panoramix/models.py +++ b/panoramix/models.py @@ -269,8 +269,8 @@ def grains(self): DB_TIME_GRAINS = { 'presto': ( Grain('Time Column', '{col}'), - Grain('week', "date_trunc('week', {col})"), - Grain('month', "date_trunc('month', {col})"), + Grain('week', "date_trunc('week', CAST({col} AS DATE))"), + Grain('month', "date_trunc('month', CAST({col} AS DATE))"), ), 'mysql': ( Grain('Time Column', '{col}'),