diff --git a/src/Ringo/Generator/Populate/Dimension.hs b/src/Ringo/Generator/Populate/Dimension.hs index a5cc5f7..980666b 100644 --- a/src/Ringo/Generator/Populate/Dimension.hs +++ b/src/Ringo/Generator/Populate/Dimension.hs @@ -32,7 +32,7 @@ dimensionTablePopulateSQL popMode fact dimTableName = do baseWhereCs = [ "(\n" <> Text.intercalate "\nOR " [ c <> " IS NOT NULL" | (_, c) <- colMapping ] <> "\n)" - , timeCol <> " <= ?" + , timeCol <> " < ?" ] insertC selectC whereCs = @@ -46,7 +46,7 @@ dimensionTablePopulateSQL popMode fact dimTableName = do return $ case popMode of FullPopulation -> insertC baseSelectC baseWhereCs IncrementalPopulation -> - insertC baseSelectC (baseWhereCs ++ [ timeCol <> " > ?" ]) + insertC baseSelectC (baseWhereCs ++ [ timeCol <> " >= ?" ]) <> "\nLEFT JOIN " <> dimTableName <> " ON\n" <> Text.intercalate " \nAND " [ fullColumnName dimTableName c1 <> " = " <> fullColumnName "x" c2 diff --git a/src/Ringo/Generator/Populate/Fact.hs b/src/Ringo/Generator/Populate/Fact.hs index bbcb9a0..c3a2712 100644 --- a/src/Ringo/Generator/Populate/Fact.hs +++ b/src/Ringo/Generator/Populate/Fact.hs @@ -195,7 +195,7 @@ factTablePopulateSQL popMode fact = do , ftpsSelectTable = fTableName , ftpsJoinClauses = joinClauses , ftpsWhereClauses = - timeCol <> " <= ?" : [ timeCol <> " > ?" | popMode == IncrementalPopulation ] + timeCol <> " < ?" : [ timeCol <> " >= ?" | popMode == IncrementalPopulation ] , ftpsGroupByCols = map ((groupByColPrefix <>) . fst3) . filter thd3 $ colMap }