Skip to content

Commit cbc8efc

Browse files
igorlukaninKSDaemon
authored andcommitted
Update docs
1 parent 86adc4d commit cbc8efc

File tree

4 files changed

+31
-22
lines changed

4 files changed

+31
-22
lines changed

docs/pages/product/caching/matching-pre-aggregations.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,10 @@ the values should be the start and end days of the month, i.e.,
7777
`['2020-01-01T00:00:00.000', '2020-01-31T23:59:59.999']`; when the granularity
7878
is `day`, the values should be the start and end hours of the day, i.e.,
7979
`['2020-01-01T00:00:00.000', '2020-01-01T23:59:59.999']`. Date ranges are
80-
inclusive, and the minimum granularity is `second`. Use the
81-
[`allow_non_strict_date_range_match`][ref-non-strict-date-range-match] to allow
82-
a pre-aggregation to match a non-strict date range anyway.
80+
inclusive, and the minimum granularity is `second`. By default, this is ensured
81+
via the [`allow_non_strict_date_range_match`][ref-non-strict-date-range-match]
82+
parameter of pre-aggregations: it allows to match _non-strict date ranges_ and is
83+
set to `true` by default.
8384
- **The time zone in the query must match the time zone of a pre-aggregation.**
8485
You can configure a list of time zones that pre-aggregations will be built for
8586
using the [`scheduled_refresh_time_zones`][ref-conf-scheduled-refresh-time-zones]

docs/pages/product/configuration/visualization-tools/superset.mdx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,6 @@ The `COUNT(*)` aggregate function is being mapped to a measure of type
117117
[count](/reference/data-model/types-and-formats#count) in Cube's
118118
**Orders** data model file.
119119

120-
## Additional configuration
121-
122-
### Pre-aggregations
123-
124-
To allow queries from Superset to match pre-aggregations in Cube, [the
125-
`allow_non_strict_date_range_match`
126-
property][ref-schema-ref-preagg-allownonstrict] must be set to `true` in the
127-
pre-aggregation definition. This is because Superset uses loose date ranges when
128-
generating SQL queries.
129120

130121
[ref-getting-started]: /product/getting-started/cloud
131122
[ref-schema-ref-preagg-allownonstrict]:

docs/pages/reference/configuration/environment-variables.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,16 @@ to use for storing pre-aggregations.
10571057
It can be also set using the [`pre_aggregations_schema` configuration
10581058
option](/reference/configuration/config#pre_aggregations_schema).
10591059

1060+
## `CUBEJS_PRE_AGGREGATIONS_ALLOW_NON_STRICT_DATE_RANGE_MATCH`
1061+
1062+
If `true`, allows non-strict date range matching for pre-aggregations by default.
1063+
This can be overridden for individual pre-aggregations using the
1064+
[`allow_non_strict_date_range_match`][ref-schema-ref-preagg-allownonstrict] parameter.
1065+
1066+
| Possible Values | Default in Development | Default in Production |
1067+
| --------------- | ---------------------- | --------------------- |
1068+
| `true`, `false` | `true` | `true` |
1069+
10601070
## `CUBEJS_REFRESH_WORKER`
10611071

10621072
If `true`, this instance of Cube will **only** refresh pre-aggregations.
@@ -1078,8 +1088,6 @@ mode](/product/caching/using-pre-aggregations#rollup-only-mode) for details.
10781088
It can be also set using the [`orchestrator_options.rollupOnlyMode` configuration
10791089
option](/reference/configuration/config#orchestrator_options).
10801090

1081-
1082-
10831091
## `CUBEJS_SCHEDULED_REFRESH_TIMEZONES`
10841092

10851093
A comma-separated [list of timezones to schedule refreshes
@@ -1688,3 +1696,4 @@ The port for a Cube deployment to listen to API connections on.
16881696
[ref-sql-api-streaming]: /product/apis-integrations/sql-api#streaming
16891697
[ref-row-limit]: /product/apis-integrations/queries#row-limit
16901698
[mysql-server-tz-support]: https://dev.mysql.com/doc/refman/8.4/en/time-zone-support.html
1699+
[ref-schema-ref-preagg-allownonstrict]: /reference/data-model/pre-aggregations#allow_non_strict_date_range_match

docs/pages/reference/data-model/pre-aggregations.mdx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,14 +1110,20 @@ refreshes.
11101110

11111111
### `allow_non_strict_date_range_match`
11121112

1113-
The `allow_non_strict_date_range_match` property can be used to allow queries to
1114-
match this pre-aggregation when using non-strict date ranges.
1115-
By default Cube checks if requested date range exactly matches pre-aggregation granularity.
1116-
For example if you're requesting half of a day or your date range filter is just one millisecond off for daily granularity pre-aggregation Cube would not use such a pre-aggregation by default.
1117-
Use this flag to lift this strict check.
1118-
This is useful
1119-
when using a visualization tools such as Tableau or [Apache
1120-
Superset][ref-config-downstream-superset] that use loose date ranges by default.
1113+
The `allow_non_strict_date_range_match` parameter is used to allow queries to match a
1114+
pre-aggregation even if a query contains a _non-strict date range_. It is set to `true`
1115+
by default via the [`CUBEJS_PRE_AGGREGATIONS_ALLOW_NON_STRICT_DATE_RANGE_MATCH`][ref-env-allow-non-strict]
1116+
environment variable.
1117+
1118+
If this flag is set to `false`, Cube would check if requested date range exactly matches
1119+
pre-aggregation granularity. For example, if you're requesting half of a day or your date
1120+
range filter is just one millisecond off for a pre-aggregation with the daily granularity,
1121+
Cube would not use such a pre-aggregation.
1122+
1123+
With this flag set to `true`, that strict check is lifted. It allows queries from BI tools
1124+
to still match pre-aggregations at the cost of a slight potential data discrepancy.
1125+
This is convenient when using Cube with visualization tools such as [Tableau][ref-config-downstream-tableau]
1126+
or [Apache Superset][ref-config-downstream-superset] that use loose date ranges.
11211127

11221128
<CodeTabs>
11231129

@@ -1767,3 +1773,5 @@ cubes:
17671773
[ref-pre-aggs]: /product/caching/using-pre-aggregations
17681774
[ref-ref-cubes]: /reference/data-model/cube
17691775
[ref-custom-granularity]: /reference/data-model/dimensions#granularities
1776+
[ref-env-allow-non-strict]: /reference/configuration/environment-variables#cubejs-pre-aggregations-allow-non-strict-date-range-match
1777+
[ref-config-downstream-tableau]: /product/configuration/visualization-tools/tableau

0 commit comments

Comments
 (0)