Skip to content

Commit

Permalink
fix: incorrect WHERE for refreshKey every
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Mar 29, 2020
1 parent 133857e commit bf8b648
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cubejs-schema-compiler/adapter/BaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1625,12 +1625,13 @@ class BaseQuery {
(originalRefreshKey, refreshKeyCube) => {
if (cubeFromPath.refreshKey && cubeFromPath.refreshKey.immutable) {
return `SELECT ${this.incrementalRefreshKey(preAggregationQueryForSql, `(${originalRefreshKey})`)}`;
} else {
} else if (!cubeFromPath.refreshKey) {
// TODO handle WHERE while generating originalRefreshKey
return refreshKeyCube === preAggregationQueryForSql.timeDimensions[0].path()[0] ?
`${originalRefreshKey} WHERE ${preAggregationQueryForSql.timeDimensions[0].filterToWhere()}` :
originalRefreshKey;
}
return originalRefreshKey;
}
),
{ preAggregationQuery: true }
Expand Down

0 comments on commit bf8b648

Please sign in to comment.