indexSql(cube, preAggregation, index, indexName, tableName) { if (preAggregation.external && this.externalQueryClass) { return this.externalQuery().indexSql(cube, preAggregation, index, indexName, tableName); } if (index.columns) { const escapedColumns = this.evaluateIndexColumns(cube, index); return this.paramAllocator.buildSqlAndParams(this.createIndexSql(indexName, tableName, escapedColumns)); } else { throw new Error('Index SQL support is not implemented'); } }
externalPreAggregationQuery() { if (!this.options.preAggregationQuery && this.externalQueryClass) { const preAggregationForQuery = this.preAggregations.findPreAggregationForQuery(); if (preAggregationForQuery && preAggregationForQuery.preAggregation.external) { return true; } const preAggregationsDescription = this.preAggregations.preAggregationsDescription(); return preAggregationsDescription.length && R.all((p) => p.external, preAggregationsDescription); } return false; }
function init() { const ExFunction = shared.external.Function const ExFuncSuper = getPrototypeOf(ExFunction) const ExFuncProtoSuper = getPrototypeOf(ExFunction.prototype) function toExternalFunction(func) { setPrototypeOf(func, ExFuncSuper) if (has(func, "prototype")) { setPrototypeOf(func.prototype, ExFuncProtoSuper) } return func } return toExternalFunction }
async fetchTables(preAggregation) { if (preAggregation.external && !this.externalDriverFactory) { throw new Error('externalDriverFactory should be set in order to use external pre-aggregations'); } const client = preAggregation.external ? await this.externalDriverFactory() : await this.driverFactory(); const newTables = await client.getTablesQuery(preAggregation.preAggregationsSchema); await this.cacheDriver.set( this.tablesRedisKey(preAggregation), newTables, this.preAggregations.options.preAggregationsSchemaCacheExpire || 60 * 60 ); return newTables; }
refresh(newVersionEntry, invalidationKeys) { return (client) => { let refreshStrategy = this.refreshImplStoreInSourceStrategy; if (this.preAggregation.external) { const readOnly = client.config && client.config.readOnly || client.readOnly && (typeof client.readOnly === 'boolean' ? client.readOnly : client.readOnly()); refreshStrategy = readOnly ? this.refreshImplStreamExternalStrategy : this.refreshImplTempTableExternalStrategy; } return cancelCombinator( saveCancelFn => refreshStrategy.bind(this)(client, newVersionEntry, saveCancelFn, invalidationKeys) ); }; }
function init() { const ExObject = shared.external.Object return { create(proto, properties) { if (properties === null) { properties = void 0 } if (proto === null || isObjectLike(proto)) { return Object.create(proto, properties) } return properties === void 0 ? new ExObject : Object.defineProperties(new ExObject, properties) } } }
maskFunction(function (filename) { validateString(filename, "filename") if (this.loaded) { throw new shared.external.Error("Module already loaded: " + this.id) } let entry = Entry.get(this) const { id } = entry const { scratchCache } = Loader.state.module // Reassociate entries from the parse phase for modules created // via `new Module()`. if (has(scratchCache, id)) { const otherEntry = Entry.get(scratchCache[id]) if (entry !== otherEntry) { otherEntry.exports = this.exports otherEntry.module = this otherEntry.runtime = null entry = otherEntry Entry.set(this, otherEntry) Reflect.deleteProperty(scratchCache, id) } } loader(entry, filename) }, RealProto.load)
preAggregationDescriptionFor(cube, foundPreAggregation) { const { preAggregationName, preAggregation } = foundPreAggregation; const tableName = this.preAggregationTableName(cube, preAggregationName, preAggregation); const refreshKeyQueries = this.query.preAggregationInvalidateKeyQueries(cube, preAggregation); return { preAggregationsSchema: this.query.preAggregationSchema(), tableName, loadSql: this.query.preAggregationLoadSql(cube, preAggregation, tableName), sql: this.query.preAggregationSql(cube, preAggregation), invalidateKeyQueries: refreshKeyQueries.queries, refreshKeyRenewalThresholds: refreshKeyQueries.refreshKeyRenewalThresholds, external: preAggregation.external, indexesSql: Object.keys(preAggregation.indexes || {}).map( index => { const indexName = this.preAggregationTableName(cube, `${preAggregationName}_${index}`, preAggregation, true); return { indexName, sql: this.query.indexSql( cube, preAggregation, preAggregation.indexes[index], indexName, tableName ) }; } ) }; }
tablesRedisKey(preAggregation) { return `SQL_PRE_AGGREGATIONS_TABLES_${this.redisPrefix}${preAggregation.external ? '_EXT' : ''}`; }
], waitForRenew: true, external: options.external, requestId: options.requestId
function init() { const ExError = shared.external.Error
["Reflect", shared.external.Reflect], ["console", console] ])
function init() { const ExReflect = shared.external.Reflect
TypeError: ExTypeError, URIError: ExURIError } = shared.external