From f9337acb134cb5d8cdad6516148581ec7d89648b Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Wed, 10 Jun 2026 12:51:27 +0200 Subject: [PATCH 1/3] feat(api-gateway)!: Remove deprecated renewQuery parameter BREAKING CHANGE: The `renewQuery` parameter of the `/v1/load` REST endpoint and the GraphQL `cube` query has been removed. Use the `cache` parameter instead: `cache: 'must-revalidate'` replaces `renewQuery: true`, and the default `stale-if-slow` replaces `renewQuery: false`. --- DEPRECATION.md | 8 +-- .../core-data-apis/graphql-api/reference.mdx | 1 - .../core-data-apis/rest-api/query-format.mdx | 19 ------- .../core-data-apis/graphql-api/reference.mdx | 1 - .../core-data-apis/rest-api/query-format.mdx | 21 -------- packages/cubejs-api-gateway/src/graphql.ts | 4 +- packages/cubejs-api-gateway/src/query.js | 9 ---- .../cubejs-api-gateway/src/types/query.ts | 2 - .../cubejs-api-gateway/src/types/request.ts | 1 - .../cubejs-backend-shared/src/shared-types.ts | 4 +- packages/cubejs-client-core/src/types.ts | 6 +-- packages/cubejs-client-dx/index.d.ts | 2 - .../cubejs-client-vue3/src/QueryBuilder.js | 9 ---- .../tests/unit/QueryBuilder.spec.js | 28 ---------- .../QueryBuilderV2/utils/validate-query.ts | 5 -- .../src/components/CachePane.tsx | 3 +- .../src/orchestrator/PreAggregations.ts | 4 +- .../src/orchestrator/QueryCache.ts | 7 +-- .../test/unit/PreAggregations.test.ts | 4 +- .../test/unit/QueryOrchestrator.test.js | 54 +++++++++---------- .../postgres/views-join-order-2.test.ts | 1 - 21 files changed, 44 insertions(+), 149 deletions(-) diff --git a/DEPRECATION.md b/DEPRECATION.md index 9d18224818dc8..9cf128f27c8bc 100644 --- a/DEPRECATION.md +++ b/DEPRECATION.md @@ -66,7 +66,7 @@ features: | Removed | [Node.js 18](#nodejs-18) | v0.36.0 | v1.3.0 | | Removed | [`CUBEJS_SCHEDULED_REFRESH_CONCURRENCY`](#cubejs_scheduled_refresh_concurrency) | v1.2.7 | v1.7.0 | | Deprecated | [Node.js 20](#nodejs-20) | v1.3.0 | | -| Deprecated | [`renewQuery` parameter of the `/v1/load` endpoint](#renewquery-parameter-of-the-v1load-endpoint) | v1.3.73 | | +| Removed | [`renewQuery` parameter of the `/v1/load` endpoint](#renewquery-parameter-of-the-v1load-endpoint) | v1.3.73 | v1.7.0 | | Removed | [Elasticsearch driver](#elasticsearch-driver) | v1.6.0 | v1.7.0 | | Deprecated | [`context_to_roles`](#context-to-roles) | v1.6.4 | | @@ -424,8 +424,10 @@ no more new features, only security updates. Please upgrade to Node.js 22 or hig **Deprecated in Release: v1.3.73** -This parameter is deprecated and will be removed in future releases. See [cache control](https://cube.dev/docs/product/apis-integrations/rest-api#cache-control) -options and use the new `cache` parameter of the `/v1/load` endpoint instead. +**Removed in Release: v1.7.0** + +This parameter has been removed. See [cache control](https://cube.dev/docs/product/apis-integrations/rest-api#cache-control) +options and use the `cache` parameter of the `/v1/load` endpoint instead. ### Elasticsearch driver diff --git a/docs-mintlify/reference/core-data-apis/graphql-api/reference.mdx b/docs-mintlify/reference/core-data-apis/graphql-api/reference.mdx index 7b29ff5878ce7..a78c0af2c400a 100644 --- a/docs-mintlify/reference/core-data-apis/graphql-api/reference.mdx +++ b/docs-mintlify/reference/core-data-apis/graphql-api/reference.mdx @@ -30,7 +30,6 @@ query { - **`timezone` (`String`):** The [time zone][ref-time-zone] for your query. You can set the desired time zone in the [TZ Database Name](https://en.wikipedia.org/wiki/Tz_database) format, e.g., `America/Los_Angeles`. -- **`renewQuery` (`Boolean`):** If `renewQuery` is set to `true`, Cube will renew all `refreshKey` for queries and query results in the foreground. The default value is `false`. - **`ungrouped` (`Boolean`):** If set to `true`, Cube will run an [ungrouped query][ref-ungrouped-query]. diff --git a/docs-mintlify/reference/core-data-apis/rest-api/query-format.mdx b/docs-mintlify/reference/core-data-apis/rest-api/query-format.mdx index 2a6ecda365681..1e3bcbe5da6a1 100644 --- a/docs-mintlify/reference/core-data-apis/rest-api/query-format.mdx +++ b/docs-mintlify/reference/core-data-apis/rest-api/query-format.mdx @@ -45,23 +45,6 @@ The default value is `false`. - `timezone`: A [time zone][ref-time-zone] for your query. You can set the desired time zone in the [TZ Database Name](https://en.wikipedia.org/wiki/Tz_database) format, e.g., `America/Los_Angeles`. -- `renewQuery`: If `renewQuery` is set to `true`, Cube will renew all - [`refreshKey`][ref-schema-ref-preaggs-refreshkey] for queries and query - results in the foreground. However, if the - [`refreshKey`][ref-schema-ref-preaggs-refreshkey] (or - [`refreshKey.every`][ref-schema-ref-preaggs-refreshkey-every]) doesn't - indicate that there's a need for an update this setting has no effect. The - default value is `false`. - - - -Cube provides only eventual consistency guarantee. Using a small -[`refreshKey.every`][ref-schema-ref-preaggs-refreshkey-every] value together -with `renewQuery` to achieve immediate consistency can lead to endless -refresh loops and overall system instability. - - - - `ungrouped`: If set to `true`, Cube will run an [ungrouped query][ref-ungrouped-query]. - `joinHints`: Query-time [join hints][ref-join-hints], provided as an array of @@ -675,8 +658,6 @@ refer to its documentation for more examples. [ref-client-core-resultset-drilldown]: /reference/javascript-sdk/reference/cubejs-client-core#drilldown -[ref-schema-ref-preaggs-refreshkey]: /reference/data-modeling/pre-aggregations#refresh_key -[ref-schema-ref-preaggs-refreshkey-every]: /reference/data-modeling/pre-aggregations#every [ref-schema-ref-preaggs-dimensions]: /reference/data-modeling/pre-aggregations#dimensions [ref-schema-ref-preaggs-time-dimension]: /reference/data-modeling/pre-aggregations#time_dimension [ref-relative-date-range]: #relative-date-range diff --git a/docs/content/product/apis-integrations/core-data-apis/graphql-api/reference.mdx b/docs/content/product/apis-integrations/core-data-apis/graphql-api/reference.mdx index 66fc15c81ff9c..323317348f092 100644 --- a/docs/content/product/apis-integrations/core-data-apis/graphql-api/reference.mdx +++ b/docs/content/product/apis-integrations/core-data-apis/graphql-api/reference.mdx @@ -27,7 +27,6 @@ query { - **`timezone` (`String`):** The [time zone][ref-time-zone] for your query. You can set the desired time zone in the [TZ Database Name](https://en.wikipedia.org/wiki/Tz_database) format, e.g., `America/Los_Angeles`. -- **`renewQuery` (`Boolean`):** If `renewQuery` is set to `true`, Cube will renew all `refreshKey` for queries and query results in the foreground. The default value is `false`. - **`ungrouped` (`Boolean`):** If set to `true`, Cube will run an [ungrouped query][ref-ungrouped-query]. diff --git a/docs/content/product/apis-integrations/core-data-apis/rest-api/query-format.mdx b/docs/content/product/apis-integrations/core-data-apis/rest-api/query-format.mdx index 32405961d0d7c..712788ff3582f 100644 --- a/docs/content/product/apis-integrations/core-data-apis/rest-api/query-format.mdx +++ b/docs/content/product/apis-integrations/core-data-apis/rest-api/query-format.mdx @@ -42,23 +42,6 @@ The default value is `false`. - `timezone`: A [time zone][ref-time-zone] for your query. You can set the desired time zone in the [TZ Database Name](https://en.wikipedia.org/wiki/Tz_database) format, e.g., `America/Los_Angeles`. -- `renewQuery`: If `renewQuery` is set to `true`, Cube will renew all - [`refreshKey`][ref-schema-ref-preaggs-refreshkey] for queries and query - results in the foreground. However, if the - [`refreshKey`][ref-schema-ref-preaggs-refreshkey] (or - [`refreshKey.every`][ref-schema-ref-preaggs-refreshkey-every]) doesn't - indicate that there's a need for an update this setting has no effect. The - default value is `false`. - - - -Cube provides only eventual consistency guarantee. Using a small -[`refreshKey.every`][ref-schema-ref-preaggs-refreshkey-every] value together -with `renewQuery` to achieve immediate consistency can lead to endless -refresh loops and overall system instability. - - - - `ungrouped`: If set to `true`, Cube will run an [ungrouped query][ref-ungrouped-query]. - `joinHints`: Query-time [join hints][ref-join-hints], provided as an array of @@ -672,10 +655,6 @@ refer to its documentation for more examples. [ref-client-core-resultset-drilldown]: /product/apis-integrations/javascript-sdk/reference/cubejs-client-core#drilldown -[ref-schema-ref-preaggs-refreshkey]: - /product/data-modeling/reference/pre-aggregations#refresh_key -[ref-schema-ref-preaggs-refreshkey-every]: - /product/data-modeling/reference/pre-aggregations#every [ref-schema-ref-preaggs-dimensions]: /product/data-modeling/reference/pre-aggregations#dimensions [ref-schema-ref-preaggs-time-dimension]: diff --git a/packages/cubejs-api-gateway/src/graphql.ts b/packages/cubejs-api-gateway/src/graphql.ts index b3a8d89fc714f..4a328d1cd6a02 100644 --- a/packages/cubejs-api-gateway/src/graphql.ts +++ b/packages/cubejs-api-gateway/src/graphql.ts @@ -363,7 +363,7 @@ function parseDates(result: any) { } export function getJsonQuery(metaConfig: any, args: Record, infos: GraphQLResolveInfo) { - const { where, limit, offset, timezone, orderBy, renewQuery, ungrouped, cache } = args; + const { where, limit, offset, timezone, orderBy, ungrouped, cache } = args; const measures: string[] = []; const dimensions: string[] = []; @@ -460,7 +460,6 @@ export function getJsonQuery(metaConfig: any, args: Record, infos: ...(offset && { offset }), ...(timezone && { timezone }), ...(filters.length && { filters }), - ...(renewQuery && { renewQuery }), ...(cache && { cache }), ...(ungrouped && { ungrouped }), }; @@ -639,7 +638,6 @@ export function makeSchema(metaConfig: any): GraphQLSchema { limit: intArg(), offset: intArg(), timezone: stringArg(), - renewQuery: booleanArg(), cache: stringArg(), ungrouped: booleanArg(), orderBy: arg({ diff --git a/packages/cubejs-api-gateway/src/query.js b/packages/cubejs-api-gateway/src/query.js index 88d5132648848..07be6953b19f3 100644 --- a/packages/cubejs-api-gateway/src/query.js +++ b/packages/cubejs-api-gateway/src/query.js @@ -187,8 +187,6 @@ const querySchema = Joi.object().keys({ limit: Joi.number().integer().strict().min(0), offset: Joi.number().integer().strict().min(0), total: Joi.boolean(), - // @deprecated - renewQuery: Joi.boolean(), cacheMode: Joi.valid('stale-if-slow', 'stale-while-revalidate', 'must-revalidate', 'no-cache'), cache: Joi.valid('stale-if-slow', 'stale-while-revalidate', 'must-revalidate', 'no-cache'), ungrouped: Joi.boolean(), @@ -304,19 +302,12 @@ function parseInputMemberExpression(expression) { function normalizeQueryCacheMode(query, cacheMode) { if (cacheMode !== undefined) { query.cacheMode = cacheMode; - } else if (!query.cache && query?.renewQuery !== undefined) { - // TODO: Drop this when renewQuery will be removed - query.cacheMode = query.renewQuery === true - ? 'must-revalidate' - : 'stale-if-slow'; } else if (!query.cache) { query.cacheMode = 'stale-if-slow'; } else { query.cacheMode = query.cache; } - // TODO: Drop this when renewQuery will be removed - query.renewQuery = undefined; query.cache = undefined; return query; diff --git a/packages/cubejs-api-gateway/src/types/query.ts b/packages/cubejs-api-gateway/src/types/query.ts index 26b0e26e263da..7b42fd7c046d7 100644 --- a/packages/cubejs-api-gateway/src/types/query.ts +++ b/packages/cubejs-api-gateway/src/types/query.ts @@ -140,8 +140,6 @@ interface Query { totalQuery?: boolean; order?: any; timezone?: string; - // @deprecated - renewQuery?: boolean; cacheMode?: CacheMode; // used after query normalization cache?: CacheMode; // Used in public interface ungrouped?: boolean; diff --git a/packages/cubejs-api-gateway/src/types/request.ts b/packages/cubejs-api-gateway/src/types/request.ts index 8478d008354a2..9b78a1afda503 100644 --- a/packages/cubejs-api-gateway/src/types/request.ts +++ b/packages/cubejs-api-gateway/src/types/request.ts @@ -121,7 +121,6 @@ type BaseRequest = { }; type RequestQuery = Record | Record[] & { - renewQuery?: boolean; cacheMode?: CacheMode; }; diff --git a/packages/cubejs-backend-shared/src/shared-types.ts b/packages/cubejs-backend-shared/src/shared-types.ts index 52eb4fc09db74..9abcc1e2ab266 100644 --- a/packages/cubejs-backend-shared/src/shared-types.ts +++ b/packages/cubejs-backend-shared/src/shared-types.ts @@ -1,5 +1,5 @@ /* -stale-if-slow (default) — equivalent to previously used renewQuery: false +stale-if-slow (default) If refresh keys are up-to-date, returns the value from cache If refresh keys are expired, tries to return the value from the database Returns fresh value from the database if the query executed in the database until the first “Continue wait” interval is reached @@ -10,7 +10,7 @@ stale-while-revalidate — AKA “backgroundRefresh” If refresh keys are expired, returns stale data from cache Updates the cache in background -must-revalidate — equivalent to previously used renewQuery: true +must-revalidate If refresh keys are up-to-date, returns the value from cache If refresh keys are expired, tries to return the value from the database Returns fresh value from the database even if it takes minutes and many “Continue wait” intervals diff --git a/packages/cubejs-client-core/src/types.ts b/packages/cubejs-client-core/src/types.ts index 876533d97d471..f9d679e9a2c7c 100644 --- a/packages/cubejs-client-core/src/types.ts +++ b/packages/cubejs-client-core/src/types.ts @@ -162,8 +162,6 @@ export interface Query { offset?: number; order?: TQueryOrderObject | TQueryOrderArray; timezone?: string; - // @deprecated - renewQuery?: boolean; ungrouped?: boolean; responseFormat?: 'compact' | 'columnar' | 'default'; total?: boolean; @@ -600,7 +598,7 @@ export type ProgressResponse = { /** * Cache mode options for query execution. * - * - **stale-if-slow** (default): Equivalent to previously used `renewQuery: false`. + * - **stale-if-slow** (default): * If refresh keys are up-to-date, returns the value from cache. * If refresh keys are expired, tries to return the value from the database. * Returns fresh value from the database if the query executed until the first "Continue wait" interval is reached. @@ -611,7 +609,7 @@ export type ProgressResponse = { * If refresh keys are expired, returns stale data from cache. * Updates the cache in background. * - * - **must-revalidate**: Equivalent to previously used `renewQuery: true`. + * - **must-revalidate**: * If refresh keys are up-to-date, returns the value from cache. * If refresh keys are expired, tries to return the value from the database. * Returns fresh value from the database even if it takes minutes and many "Continue wait" intervals. diff --git a/packages/cubejs-client-dx/index.d.ts b/packages/cubejs-client-dx/index.d.ts index c37dcb86385c0..9a43412d0549c 100644 --- a/packages/cubejs-client-dx/index.d.ts +++ b/packages/cubejs-client-dx/index.d.ts @@ -19,8 +19,6 @@ declare module "@cubejs-client/core" { offset?: number; order?: IntrospectedTQueryOrderObject | IntrospectedTQueryOrderArray; timezone?: string; - // @deprecated - renewQuery?: boolean; ungrouped?: boolean; } diff --git a/packages/cubejs-client-vue3/src/QueryBuilder.js b/packages/cubejs-client-vue3/src/QueryBuilder.js index eca777799cc82..26b19c04a97bf 100644 --- a/packages/cubejs-client-vue3/src/QueryBuilder.js +++ b/packages/cubejs-client-vue3/src/QueryBuilder.js @@ -120,7 +120,6 @@ export default { availableSegments: [], limit: null, offset: null, - renewQuery: false, order: null, prevValidatedQuery: null, granularities: GRANULARITIES, @@ -151,7 +150,6 @@ export default { removeLimit, setOffset, removeOffset, - renewQuery, order, orderMembers, } = this; @@ -180,7 +178,6 @@ export default { removeLimit, setOffset, removeOffset, - renewQuery, order, orderMembers, setOrder: this.setOrder, @@ -349,10 +346,6 @@ export default { if (this.order) { validatedQuery.order = this.order; } - - if (this.renewQuery) { - validatedQuery.renewQuery = this.renewQuery; - } } if ( @@ -430,7 +423,6 @@ export default { filters = [], limit, offset, - renewQuery, order, } = query || this.initialQuery; @@ -476,7 +468,6 @@ export default { this.availableSegments = this.meta.membersForQuery({}, 'segments') || []; this.limit = limit || 10000; this.offset = offset || null; - this.renewQuery = renewQuery || false; this.order = order || null; }, addMember(element, member) { diff --git a/packages/cubejs-client-vue3/tests/unit/QueryBuilder.spec.js b/packages/cubejs-client-vue3/tests/unit/QueryBuilder.spec.js index a1bee696981fb..5ddd5269ac686 100644 --- a/packages/cubejs-client-vue3/tests/unit/QueryBuilder.spec.js +++ b/packages/cubejs-client-vue3/tests/unit/QueryBuilder.spec.js @@ -746,34 +746,6 @@ describe('QueryBuilder.vue', () => { expect(wrapper.vm.offset).toBe(10); }); - it('sets renewQuery', async () => { - const cube = createCubeApi(); - jest - .spyOn(cube, 'request') - .mockImplementation(fetchMock(load)) - .mockImplementationOnce(fetchMock(meta)); - - const filter = { - member: 'Orders.status', - operator: 'equals', - values: ['invalid'], - }; - - const wrapper = shallowMount(QueryBuilder, { - props: { - cubeApi: cube, - query: { - filters: [filter], - renewQuery: true, - }, - }, - }); - - await flushPromises(); - - expect(wrapper.vm.renewQuery).toBe(true); - }); - it('ignore order if empty', async () => { const cube = createCubeApi(); jest diff --git a/packages/cubejs-playground/src/QueryBuilderV2/utils/validate-query.ts b/packages/cubejs-playground/src/QueryBuilderV2/utils/validate-query.ts index 513f9bcd2ae3d..fd8ffb0431337 100644 --- a/packages/cubejs-playground/src/QueryBuilderV2/utils/validate-query.ts +++ b/packages/cubejs-playground/src/QueryBuilderV2/utils/validate-query.ts @@ -138,11 +138,6 @@ export function validateQuery(query: Record): Query { sanitizedQuery.timezone = query.timezone; } - // It's not supported yet - // if (query.renewQuery === true) { - // sanitizedQuery.renewQuery = query.renewQuery; - // } - if (query.ungrouped === true) { sanitizedQuery.ungrouped = query.ungrouped; } diff --git a/packages/cubejs-playground/src/components/CachePane.tsx b/packages/cubejs-playground/src/components/CachePane.tsx index 9e65c04711f01..b3d400326bba7 100644 --- a/packages/cubejs-playground/src/components/CachePane.tsx +++ b/packages/cubejs-playground/src/components/CachePane.tsx @@ -9,7 +9,8 @@ import { FatalError } from './Error/FatalError'; const CachePane = ({ query }) => ( { if (error) { return ; diff --git a/packages/cubejs-query-orchestrator/src/orchestrator/PreAggregations.ts b/packages/cubejs-query-orchestrator/src/orchestrator/PreAggregations.ts index fc890b7df1b6c..335ba9a9b68c6 100644 --- a/packages/cubejs-query-orchestrator/src/orchestrator/PreAggregations.ts +++ b/packages/cubejs-query-orchestrator/src/orchestrator/PreAggregations.ts @@ -545,7 +545,7 @@ export class PreAggregations { maxPartitions: this.options.maxPartitions, maxSourceRowLimit: this.options.maxSourceRowLimit, isJob: queryBody.isJob, - waitForRenew: queryBody.cacheMode !== undefined ? queryBody.cacheMode === 'must-revalidate' : queryBody.renewQuery, + waitForRenew: queryBody.cacheMode === 'must-revalidate', // TODO workaround to avoid continuous waiting on building pre-aggregation dependencies forceBuild: i === preAggregations.length - 1 ? queryBody.forceBuildPreAggregations : false, requestId: queryBody.requestId, @@ -664,7 +664,7 @@ export class PreAggregations { { maxPartitions: this.options.maxPartitions, maxSourceRowLimit: this.options.maxSourceRowLimit, - waitForRenew: queryBody.cacheMode !== undefined ? queryBody.cacheMode === 'must-revalidate' : queryBody.renewQuery, + waitForRenew: queryBody.cacheMode === 'must-revalidate', requestId: queryBody.requestId, externalRefresh: this.externalRefresh, compilerCacheFn: queryBody.compilerCacheFn, diff --git a/packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts b/packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts index a0d892d331ea5..d4d6e85cecb53 100644 --- a/packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts +++ b/packages/cubejs-query-orchestrator/src/orchestrator/QueryCache.ts @@ -70,8 +70,6 @@ export type Query = { preAggregations?: PreAggregationDescription[]; groupedPartitionPreAggregations?: PreAggregationDescription[][]; preAggregationsLoadCacheByDataSource?: any; - // @deprecated - renewQuery?: boolean; cacheMode?: CacheMode; compilerCacheFn?: (subKey: string[], cacheFn: () => T) => T; }; @@ -83,8 +81,6 @@ export type QueryBody = { values?: string[]; loadRefreshKeysOnly?: boolean; scheduledRefresh?: boolean; - // @deprecated - renewQuery?: boolean; cacheMode?: CacheMode; requestId?: string; external?: boolean; @@ -286,8 +282,7 @@ export class QueryCache { } } - // renewQuery has been deprecated, but keeping it for now - if (queryBody.cacheMode === 'must-revalidate' || queryBody.renewQuery) { + if (queryBody.cacheMode === 'must-revalidate') { this.logger('Requested renew', { cacheKey, requestId: queryBody.requestId }); return this.renewQuery( query, diff --git a/packages/cubejs-query-orchestrator/test/unit/PreAggregations.test.ts b/packages/cubejs-query-orchestrator/test/unit/PreAggregations.test.ts index f8e31b4f4eb97..1838a8e083c9e 100644 --- a/packages/cubejs-query-orchestrator/test/unit/PreAggregations.test.ts +++ b/packages/cubejs-query-orchestrator/test/unit/PreAggregations.test.ts @@ -147,8 +147,8 @@ describe('PreAggregations', () => { const basicQuery: any = createBasicQuery(); const basicQueryExternal = createBasicQuery({ preAggregations: [{ ...basicQuery.preAggregations[0], external: true }] }); - const basicQueryWithRenew = createBasicQuery({ renewQuery: true }); - const basicQueryExternalWithRenew = createBasicQuery({ preAggregations: [{ ...basicQuery.preAggregations[0], external: true }], renewQuery: true }); + const basicQueryWithRenew = createBasicQuery({ cacheMode: 'must-revalidate' }); + const basicQueryExternalWithRenew = createBasicQuery({ preAggregations: [{ ...basicQuery.preAggregations[0], external: true }], cacheMode: 'must-revalidate' }); beforeEach(() => { mockDriver = new MockDriver(); diff --git a/packages/cubejs-query-orchestrator/test/unit/QueryOrchestrator.test.js b/packages/cubejs-query-orchestrator/test/unit/QueryOrchestrator.test.js index 6e1346de0acd8..c204758aaf085 100644 --- a/packages/cubejs-query-orchestrator/test/unit/QueryOrchestrator.test.js +++ b/packages/cubejs-query-orchestrator/test/unit/QueryOrchestrator.test.js @@ -357,7 +357,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders_number_and_count20191101 AS SELECT\n date_trunc(\'week\', ("orders".created_at::timestamptz AT TIME ZONE \'UTC\')) "orders__created_at_week", count("orders".id) "orders__count", sum("orders".number) "orders__number"\n FROM\n public.orders AS "orders"\n WHERE ("orders".created_at >= $1::timestamptz AND "orders".created_at <= $2::timestamptz) GROUP BY 1', ['2019-11-01T00:00:00Z', '2019-11-30T23:59:59Z']], invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'basic' }; const promise = queryOrchestrator.fetchQuery(query); @@ -386,7 +386,7 @@ describe('QueryOrchestrator', () => { indexName: 'orders_number_and_count_week20191101' }], }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'indexes' }; const result = await queryOrchestrator.fetchQuery(query); @@ -413,7 +413,7 @@ describe('QueryOrchestrator', () => { indexName: 'orders_number_and_count_week20191102' }], }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'index is part of query key' }); await new Promise(resolve => setTimeout(() => resolve(), 400)); @@ -431,7 +431,7 @@ describe('QueryOrchestrator', () => { invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]], indexesSql: [], }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'index is part of query key' }); console.log(result.data[0]); @@ -457,7 +457,7 @@ describe('QueryOrchestrator', () => { }], external: true }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'external indexes' }; const result = await queryOrchestrator.fetchQuery(query); @@ -489,7 +489,7 @@ describe('QueryOrchestrator', () => { external: true, dataSource: 'bar' }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'external join', dataSource: 'foo', external: true @@ -523,7 +523,7 @@ describe('QueryOrchestrator', () => { external: true, dataSource: 'csv', }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'csv import' }; const result = await queryOrchestrator.fetchQuery(query); @@ -546,7 +546,7 @@ describe('QueryOrchestrator', () => { invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]], dataSource: 'foo' }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'non default data source pre-aggregation', dataSource: 'foo', }; @@ -564,7 +564,7 @@ describe('QueryOrchestrator', () => { renewalThreshold: 21600, queries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]] }, - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'non default data source query', dataSource: 'foo', }; @@ -588,7 +588,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders_number_and_count_and_very_very_very_very_very_very_long20191101 AS SELECT\n date_trunc(\'week\', ("orders".created_at::timestamptz AT TIME ZONE \'UTC\')) "orders__created_at_week", count("orders".id) "orders__count", sum("orders".number) "orders__number"\n FROM\n public.orders AS "orders"\n WHERE ("orders".created_at >= $1::timestamptz AND "orders".created_at <= $2::timestamptz) GROUP BY 1', ['2019-11-01T00:00:00Z', '2019-11-30T23:59:59Z']], invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]], }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'silent truncate' }; let thrown = true; @@ -615,7 +615,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders_number_and_count20181101 AS SELECT\n date_trunc(\'week\', ("orders".created_at::timestamptz AT TIME ZONE \'UTC\')) "orders__created_at_week", count("orders".id) "orders__count", sum("orders".number) "orders__number"\n FROM\n public.orders_too_big AS "orders"\n WHERE ("orders".created_at >= $1::timestamptz AND "orders".created_at <= $2::timestamptz) GROUP BY 1', ['2018-11-01T00:00:00Z', '2018-11-30T23:59:59Z']], invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'cancel pre-aggregation' }; try { @@ -641,7 +641,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders AS SELECT * FROM public.orders', []], invalidateKeyQueries: [['SELECT 1', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'save structure versions' }); @@ -658,7 +658,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders AS SELECT * FROM public.orders1', []], invalidateKeyQueries: [['SELECT 1', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'save structure versions' }); @@ -678,7 +678,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders AS SELECT * FROM public.orders', []], invalidateKeyQueries: [['SELECT 2', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'save structure versions' }); } @@ -777,7 +777,7 @@ describe('QueryOrchestrator', () => { // start renew refresh as scheduled refresh does const refresh = queryOrchestrator.fetchQuery({ ...baseQuery, - renewQuery: true, + cacheMode: 'must-revalidate', requestId: `${requestId}: start refresh` }); @@ -905,7 +905,7 @@ describe('QueryOrchestrator', () => { invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]], external: true, }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'load cache should respect external flag' }; const internalPreAggregation = { @@ -922,7 +922,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.internal AS SELECT\n date_trunc(\'week\', ("orders".created_at::timestamptz AT TIME ZONE \'UTC\')) "orders__created_at_week", count("orders".id) "orders__count", sum("orders".number) "orders__number"\n FROM\n public.orders AS "orders"\n WHERE ("orders".created_at >= $1::timestamptz AND "orders".created_at <= $2::timestamptz) GROUP BY 1', ['2019-11-01T00:00:00Z', '2019-11-30T23:59:59Z']], invalidateKeyQueries: [['SELECT date_trunc(\'hour\', (NOW()::timestamptz AT TIME ZONE \'UTC\')) as current_hour', []]], }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'load cache should respect external flag' }; await queryOrchestrator.fetchQuery(internalPreAggregation); @@ -947,7 +947,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations.orders AS SELECT * FROM public.orders', []], invalidateKeyQueries: [['SELECT 2', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'pre-aggregation version entries' }); @@ -964,7 +964,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE stb_pre_aggregations_2.orders AS SELECT * FROM public.orders', []], invalidateKeyQueries: [['SELECT 3', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'pre-aggregation version entries' }); @@ -1023,7 +1023,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE pre_aggregations_1.orders AS SELECT * FROM public.orders WHERE tenant_id = 1', []], invalidateKeyQueries: [['SELECT 1', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'pre-aggregation schema cache' }); @@ -1040,7 +1040,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE pre_aggregations_2.orders AS SELECT * FROM public.orders WHERE tenant_id = 2', []], invalidateKeyQueries: [['SELECT 2', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'pre-aggregation schema cache' }); @@ -1057,7 +1057,7 @@ describe('QueryOrchestrator', () => { loadSql: ['CREATE TABLE pre_aggregations_1.orders AS SELECT * FROM public.orders WHERE tenant_id = 1', []], invalidateKeyQueries: [['SELECT 1', []]] }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'pre-aggregation schema cache' }); @@ -1499,7 +1499,7 @@ describe('QueryOrchestrator', () => { ] }, preAggregations: [], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'loadRefreshKeys should respect external flag' }; @@ -1562,7 +1562,7 @@ describe('QueryOrchestrator', () => { dataSource: 'mockDriverUnloadWithoutTempTableSupport', external: true, }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'basic' }; @@ -1589,7 +1589,7 @@ describe('QueryOrchestrator', () => { dataSource: 'streaming', external: true, }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'basic' }; @@ -1616,7 +1616,7 @@ describe('QueryOrchestrator', () => { external: true, streamOffset: 'earliest' }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'basic' }; @@ -1646,7 +1646,7 @@ describe('QueryOrchestrator', () => { streamOffset: 'earliest', readOnly: true }], - renewQuery: true, + cacheMode: 'must-revalidate', requestId: 'basic' }; diff --git a/packages/cubejs-schema-compiler/test/integration/postgres/views-join-order-2.test.ts b/packages/cubejs-schema-compiler/test/integration/postgres/views-join-order-2.test.ts index 7f278639ff8c5..555567f24e2c1 100644 --- a/packages/cubejs-schema-compiler/test/integration/postgres/views-join-order-2.test.ts +++ b/packages/cubejs-schema-compiler/test/integration/postgres/views-join-order-2.test.ts @@ -158,7 +158,6 @@ cube('D', { segments: [], filters: [], total: true, - renewQuery: false, limit: 1 }, [{ view___a_id: 1, From 6d5646edf31c3e6243c694e5cc324632b092a8d0 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Wed, 10 Jun 2026 13:07:27 +0200 Subject: [PATCH 2/3] refactor(cubeorchestrator): remove dead renew_query field from NormalizedQuery --- rust/cube/cubeorchestrator/benches/transform.rs | 1 - rust/cube/cubeorchestrator/src/query_result_transform.rs | 1 - rust/cube/cubeorchestrator/src/transport.rs | 2 -- 3 files changed, 4 deletions(-) diff --git a/rust/cube/cubeorchestrator/benches/transform.rs b/rust/cube/cubeorchestrator/benches/transform.rs index e3ba6c9ed6dca..57562aeaca7b4 100644 --- a/rust/cube/cubeorchestrator/benches/transform.rs +++ b/rust/cube/cubeorchestrator/benches/transform.rs @@ -126,7 +126,6 @@ fn build_request( total: None, total_query: None, timezone: Some("UTC".to_string()), - renew_query: None, ungrouped: None, response_format: None, filters: None, diff --git a/rust/cube/cubeorchestrator/src/query_result_transform.rs b/rust/cube/cubeorchestrator/src/query_result_transform.rs index a069d8bda04de..f4c8a29c26b27 100644 --- a/rust/cube/cubeorchestrator/src/query_result_transform.rs +++ b/rust/cube/cubeorchestrator/src/query_result_transform.rs @@ -3491,7 +3491,6 @@ mod tests { total: None, total_query: None, timezone: None, - renew_query: None, ungrouped: None, response_format: None, filters: None, diff --git a/rust/cube/cubeorchestrator/src/transport.rs b/rust/cube/cubeorchestrator/src/transport.rs index 6b8ed0b95d7c4..a32ff801b7cc4 100644 --- a/rust/cube/cubeorchestrator/src/transport.rs +++ b/rust/cube/cubeorchestrator/src/transport.rs @@ -304,8 +304,6 @@ pub struct NormalizedQuery { #[serde(skip_serializing_if = "Option::is_none")] pub timezone: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub renew_query: Option, - #[serde(skip_serializing_if = "Option::is_none")] pub ungrouped: Option, #[serde(skip_serializing_if = "Option::is_none")] pub response_format: Option, From 1a2d0e15dfa99cd01a51ef829a99bf63c4b291ff Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Wed, 10 Jun 2026 16:34:18 +0200 Subject: [PATCH 3/3] docs: remove stale renewQuery row from cubejs-client-core Query reference --- .../reference/javascript-sdk/reference/cubejs-client-core.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs-mintlify/reference/javascript-sdk/reference/cubejs-client-core.mdx b/docs-mintlify/reference/javascript-sdk/reference/cubejs-client-core.mdx index c75662c93393f..5675bbbb6a7fb 100644 --- a/docs-mintlify/reference/javascript-sdk/reference/cubejs-client-core.mdx +++ b/docs-mintlify/reference/javascript-sdk/reference/cubejs-client-core.mdx @@ -938,7 +938,6 @@ limit? | number | measures? | string[] | offset? | number | order? | [TQueryOrderObject](#types-t-query-order-object) | [TQueryOrderArray](#types-t-query-order-array) | -renewQuery? | boolean | segments? | string[] | timeDimensions? | [TimeDimension](#types-time-dimension)[] | timezone? | string |