From 3b7603b3111d0e7f4f43ed95f963d15cdf468230 Mon Sep 17 00:00:00 2001 From: Abhinav Sarkar Date: Tue, 19 Jan 2016 01:05:20 +0530 Subject: [PATCH] Fixes dim time population select clause. - Dim time fact column population had a bug where the time id was being rounded instead of being floored. This fixes it. --- src/Ringo/Generator/Populate/Fact.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ringo/Generator/Populate/Fact.hs b/src/Ringo/Generator/Populate/Fact.hs index c3a2712..b68fe28 100644 --- a/src/Ringo/Generator/Populate/Fact.hs +++ b/src/Ringo/Generator/Populate/Fact.hs @@ -125,8 +125,8 @@ factTablePopulateSQL popMode fact = do timeUnitColumnInsertSQL cName = let colName = timeUnitColumnName dimIdColName cName settingTimeUnit in ( colName - , "extract(epoch from " <> fullColumnName fTableName cName <> ")::bigint/" - <> Text.pack (show $ timeUnitToSeconds settingTimeUnit) + , "floor(extract(epoch from " <> fullColumnName fTableName cName <> ")/" + <> Text.pack (show $ timeUnitToSeconds settingTimeUnit) <> ")::bigint" , True ) dimIdColumnInsertSQL cName =