Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions DEPRECATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | |

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<Info>

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.

</Info>

- `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
Expand Down Expand Up @@ -675,8 +658,6 @@ refer to its documentation for more examples.
</Info>

[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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@ limit? | number |
measures? | string[] |
offset? | number |
order? | [TQueryOrderObject](#types-t-query-order-object) &#124; [TQueryOrderArray](#types-t-query-order-array) |
renewQuery? | boolean |
segments? | string[] |
timeDimensions? | [TimeDimension](#types-time-dimension)[] |
timezone? | string |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<InfoBox>

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.

</InfoBox>

- `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
Expand Down Expand Up @@ -672,10 +655,6 @@ refer to its documentation for more examples.
</InfoBox>

[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]:
Expand Down
4 changes: 1 addition & 3 deletions packages/cubejs-api-gateway/src/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function parseDates(result: any) {
}

export function getJsonQuery(metaConfig: any, args: Record<string, any>, 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[] = [];
Expand Down Expand Up @@ -460,7 +460,6 @@ export function getJsonQuery(metaConfig: any, args: Record<string, any>, infos:
...(offset && { offset }),
...(timezone && { timezone }),
...(filters.length && { filters }),
...(renewQuery && { renewQuery }),
...(cache && { cache }),
...(ungrouped && { ungrouped }),
};
Expand Down Expand Up @@ -639,7 +638,6 @@ export function makeSchema(metaConfig: any): GraphQLSchema {
limit: intArg(),
offset: intArg(),
timezone: stringArg(),
renewQuery: booleanArg(),
cache: stringArg(),
ungrouped: booleanArg(),
orderBy: arg({
Expand Down
9 changes: 0 additions & 9 deletions packages/cubejs-api-gateway/src/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions packages/cubejs-api-gateway/src/types/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion packages/cubejs-api-gateway/src/types/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ type BaseRequest = {
};

type RequestQuery = Record<string, any> | Record<string, any>[] & {
renewQuery?: boolean;
cacheMode?: CacheMode;
};

Expand Down
4 changes: 2 additions & 2 deletions packages/cubejs-backend-shared/src/shared-types.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 2 additions & 4 deletions packages/cubejs-client-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions packages/cubejs-client-dx/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ declare module "@cubejs-client/core" {
offset?: number;
order?: IntrospectedTQueryOrderObject | IntrospectedTQueryOrderArray;
timezone?: string;
// @deprecated
renewQuery?: boolean;
ungrouped?: boolean;
}

Expand Down
9 changes: 0 additions & 9 deletions packages/cubejs-client-vue3/src/QueryBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ export default {
availableSegments: [],
limit: null,
offset: null,
renewQuery: false,
order: null,
prevValidatedQuery: null,
granularities: GRANULARITIES,
Expand Down Expand Up @@ -151,7 +150,6 @@ export default {
removeLimit,
setOffset,
removeOffset,
renewQuery,
order,
orderMembers,
} = this;
Expand Down Expand Up @@ -180,7 +178,6 @@ export default {
removeLimit,
setOffset,
removeOffset,
renewQuery,
order,
orderMembers,
setOrder: this.setOrder,
Expand Down Expand Up @@ -349,10 +346,6 @@ export default {
if (this.order) {
validatedQuery.order = this.order;
}

if (this.renewQuery) {
validatedQuery.renewQuery = this.renewQuery;
}
}

if (
Expand Down Expand Up @@ -430,7 +423,6 @@ export default {
filters = [],
limit,
offset,
renewQuery,
order,
} = query || this.initialQuery;

Expand Down Expand Up @@ -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) {
Expand Down
28 changes: 0 additions & 28 deletions packages/cubejs-client-vue3/tests/unit/QueryBuilder.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,6 @@ export function validateQuery(query: Record<string, any>): 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;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/cubejs-playground/src/components/CachePane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import { FatalError } from './Error/FatalError';
const CachePane = ({ query }) => (
<QueryRenderer
loadSql
query={{ ...query, renewQuery: true }}
cache="must-revalidate"
query={query}
render={({ sqlQuery, resultSet, error }) => {
if (error) {
return <FatalError error={error} />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ export type Query = {
preAggregations?: PreAggregationDescription[];
groupedPartitionPreAggregations?: PreAggregationDescription[][];
preAggregationsLoadCacheByDataSource?: any;
// @deprecated
renewQuery?: boolean;
cacheMode?: CacheMode;
compilerCacheFn?: <T>(subKey: string[], cacheFn: () => T) => T;
};
Expand All @@ -83,8 +81,6 @@ export type QueryBody = {
values?: string[];
loadRefreshKeysOnly?: boolean;
scheduledRefresh?: boolean;
// @deprecated
renewQuery?: boolean;
cacheMode?: CacheMode;
requestId?: string;
external?: boolean;
Expand Down Expand Up @@ -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,
Expand Down
Loading
Loading