From 6069499aecd61d6e05eab025c28be0fbffae8826 Mon Sep 17 00:00:00 2001 From: Pavel Tiunov Date: Sat, 22 Feb 2020 16:03:51 -0800 Subject: [PATCH] fix: Error: client.readOnly is not a function --- .../cubejs-query-orchestrator/orchestrator/PreAggregations.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js b/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js index 1a149b134e10a..164bf7754c903 100644 --- a/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js +++ b/packages/cubejs-query-orchestrator/orchestrator/PreAggregations.js @@ -389,7 +389,8 @@ class PreAggregationLoader { return (client) => { let refreshStrategy = this.refreshImplStoreInSourceStrategy; if (this.preAggregation.external) { - refreshStrategy = client.readOnly() ? this.refreshImplStreamExternalStrategy : this.refreshImplTempTableExternalStrategy; + refreshStrategy = client.readOnly && client.readOnly() ? + this.refreshImplStreamExternalStrategy : this.refreshImplTempTableExternalStrategy; } const resultPromise = refreshStrategy.bind(this)(client, newVersionEntry); resultPromise.cancel = () => {} // TODO implement cancel (loading rollup into table and external upload)