Skip to content

Commit

Permalink
fix: TypeError: Cannot read property 'evaluateSymbolSqlWithContext' o…
Browse files Browse the repository at this point in the history
…f undefined
  • Loading branch information
paveltiunov committed Jan 17, 2020
1 parent 7df5bd6 commit 125afd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/cubejs-schema-compiler/adapter/BaseQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1325,8 +1325,11 @@ class BaseQuery {
const preAggregationForQuery = this.preAggregations.findPreAggregationForQuery();
if (preAggregationForQuery) {
return {
renewalThreshold: this.renewalThreshold(!!preAggregationForQuery.refreshKey),
queries: this.preAggregationInvalidateKeyQueries(preAggregationForQuery.cube, preAggregationForQuery)
renewalThreshold: this.renewalThreshold(!!preAggregationForQuery.preAggregation.refreshKey),
queries: this.preAggregationInvalidateKeyQueries(
preAggregationForQuery.cube,
preAggregationForQuery.preAggregation
)
};
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/cubejs-schema-compiler/test/PreAggregationsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ describe('PreAggregations', function test() {
console.log(JSON.stringify(preAggregationsDescription, null, 2));

preAggregationsDescription[0].invalidateKeyQueries[0][0].should.match(/>=/);
console.log(JSON.stringify(query.cacheKeyQueries().queries, null, 2));
query.cacheKeyQueries().queries[0][0].should.match(/max/);

return dbRunner.testQueries(tempTablePreAggregations(preAggregationsDescription).concat([
query.buildSqlAndParams()
Expand Down

0 comments on commit 125afd7

Please sign in to comment.