Skip to content

Commit

Permalink
fix(@cubejs-backend/athena-driver): Error: Queries of this type are n…
Browse files Browse the repository at this point in the history
…ot supported for incremental refreshKey

Fixes #404
  • Loading branch information
paveltiunov committed Aug 13, 2020
1 parent 4398811 commit 2d3018d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions packages/cubejs-schema-compiler/adapter/BaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1813,17 +1813,11 @@ class BaseQuery {
incrementalRefreshKey(query, originalRefreshKey, options) {
options = options || {};
const updateWindow = options.window;
return query.evaluateSql(
null,
(FILTER_PARAMS) => query.caseWhenStatement([{
sql: FILTER_PARAMS[
query.timeDimensions[0].path()[0]
][
query.timeDimensions[0].path()[1]
].filter((from, to) => `${query.nowTimestampSql()} < ${updateWindow ? this.addTimestampInterval(this.timeStampCast(to), updateWindow) : this.timeStampCast(to)}`),
label: originalRefreshKey
}])
);
const timeDimension = query.timeDimensions[0];
return query.caseWhenStatement([{
sql: `${query.nowTimestampSql()} < ${updateWindow ? this.addTimestampInterval(timeDimension.dateToParam(), updateWindow) : timeDimension.dateToParam()}`,
label: originalRefreshKey
}]);
}

defaultRefreshKeyRenewalThreshold() {
Expand Down

0 comments on commit 2d3018d

Please sign in to comment.