Skip to content

Commit 99db541

Browse files
Merge branch 'master' into ph/support-metabase-sync
2 parents 22c74ed + b75a37a commit 99db541

File tree

118 files changed

+2097
-667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2097
-667
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -666,15 +666,16 @@ jobs:
666666
target:
667667
- x86_64-pc-windows-msvc
668668
- x86_64-apple-darwin
669+
- aarch64-apple-darwin
669670
include:
670671
- target: x86_64-pc-windows-msvc
671672
os: windows-2019
672673
executable_name: cubestored.exe
673674
strip: true
674675
# cubestored.exe: CantPackException: superfluous data between sections
675676
compress: false
676-
# Please use minimal possible version of macOS, because it produces constraint on libstdc++
677677
tar_executable: tar
678+
# Please use minimal possible version of macOS, because it produces constraint on libstdc++
678679
- target: x86_64-apple-darwin
679680
os: macos-12
680681
executable_name: cubestored
@@ -683,6 +684,14 @@ jobs:
683684
compress: false
684685
# bsd tar has a different format with Sparse files which breaks download script
685686
tar_executable: gtar
687+
- os: macos-14
688+
target: aarch64-apple-darwin
689+
executable_name: cubestored
690+
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
691+
strip: false
692+
compress: false
693+
# bsd tar has a different format with Sparse files which breaks download script
694+
tar_executable: gtar
686695
fail-fast: false
687696
permissions:
688697
contents: write

.github/workflows/rust-cubestore-master.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ jobs:
187187
target:
188188
- x86_64-pc-windows-msvc
189189
- x86_64-apple-darwin
190+
- aarch64-apple-darwin
190191
include:
191192
- os: windows-2019
192193
target: x86_64-pc-windows-msvc
@@ -201,6 +202,12 @@ jobs:
201202
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
202203
strip: false
203204
compress: false
205+
- os: macos-14
206+
target: aarch64-apple-darwin
207+
executable_name: cubestored
208+
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
209+
strip: false
210+
compress: false
204211
fail-fast: false
205212
steps:
206213
- uses: actions/checkout@v4

.github/workflows/rust-cubestore.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ jobs:
118118
target:
119119
- x86_64-pc-windows-msvc
120120
- x86_64-apple-darwin
121+
- aarch64-apple-darwin
121122
include:
122123
- os: windows-2019
123124
target: x86_64-pc-windows-msvc
@@ -132,6 +133,12 @@ jobs:
132133
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
133134
strip: false
134135
compress: false
136+
- os: macos-14
137+
target: aarch64-apple-darwin
138+
executable_name: cubestored
139+
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
140+
strip: false
141+
compress: false
135142
fail-fast: false
136143
steps:
137144
- uses: actions/checkout@v4

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,35 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.1.6](https://github.com/cube-js/cube/compare/v1.1.5...v1.1.6) (2024-11-17)
7+
8+
9+
### Bug Fixes
10+
11+
* **playground:** fix version check for yaml model generation ([#8944](https://github.com/cube-js/cube/issues/8944)) ([ab8ad2b](https://github.com/cube-js/cube/commit/ab8ad2bb0be886934f21c3ddd3be7a370b192a45))
12+
* **schema-compiler:** Time dimension filter for lambda cubes ([#8957](https://github.com/cube-js/cube/issues/8957)) ([eca7e4d](https://github.com/cube-js/cube/commit/eca7e4daa47056f137a3bc0e5735214dba8c8869))
13+
14+
15+
16+
17+
18+
## [1.1.5](https://github.com/cube-js/cube/compare/v1.1.4...v1.1.5) (2024-11-13)
19+
20+
21+
### Bug Fixes
22+
23+
* **schema-compiler:** fix Maximum call stack size exceeded if FILTER_PARAMS are used inside dimensions/measures ([#8867](https://github.com/cube-js/cube/issues/8867)) ([8e7c5c7](https://github.com/cube-js/cube/commit/8e7c5c7d0af0e672f23c8efdab0117121838fa3f))
24+
25+
26+
### Features
27+
28+
* **cubesql:** Initial SQL pushdown flattening ([#8888](https://github.com/cube-js/cube/issues/8888)) ([211d1c1](https://github.com/cube-js/cube/commit/211d1c1053dba7ed69c82f489a433602a66d78e7))
29+
* **cubestore:** Build standalone aarch64-apple-darwin, thanks [@vieira](https://github.com/vieira) ([#8950](https://github.com/cube-js/cube/issues/8950)) ([737fb60](https://github.com/cube-js/cube/commit/737fb60f68c5207001fd982d37413949a7412e28)), closes [#8949](https://github.com/cube-js/cube/issues/8949)
30+
31+
32+
33+
34+
635
## [1.1.4](https://github.com/cube-js/cube/compare/v1.1.3...v1.1.4) (2024-11-12)
736

837

docs/pages/guides/dbt.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ cubes:
259259
- {{ model.as_cube() }}
260260

261261
dimensions:
262-
{% for column in model.columns() %}
262+
{% for column in model.columns %}
263263
- name: "{{ column.name }}"
264264
sql: "{{ column.sql }}"
265265
type: "{{ column.type }}"

docs/pages/product/data-modeling/concepts/data-blending.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,17 @@ cube(`all_sales`, {
193193
});
194194
```
195195

196+
<ReferenceBox>
197+
198+
Currently, [`{cube.sql()}` function][ref-cube-sql-func] is not supported in YAML data models.
199+
Please [track this issue](https://github.com/cube-js/cube/issues/7484).
200+
201+
As a workaround, you can use JavaScript data models, put a SQL query in a
202+
[Jinja](/product/data-modeling/dynamic/jinja#jinja) variable, or load it from
203+
the [template context](/reference/python/cube#templatecontext-class).
204+
205+
</ReferenceBox>
206+
196207
Another use case of the Data Blending approach would be when you want to chart
197208
some measures (business related) together and see how they correlate.
198209

@@ -236,3 +247,5 @@ const queries = [
236247

237248
const resultSet = await cubeApi.load(queries);
238249
```
250+
251+
[ref-cube-sql-func]: /product/data-modeling/syntax#cubesql-function

docs/pages/product/data-modeling/concepts/polymorphic-cubes.mdx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,6 @@ cube(`users`, {
9090

9191
Then you can derive the `teachers` and `students` cubes from `users`:
9292

93-
<CodeTabs>
94-
95-
```yaml
96-
cubes:
97-
- name: teachers
98-
extends: users
99-
sql: >
100-
SELECT * FROM {users.sql()} WHERE type = 'teacher'
101-
102-
- name: students
103-
extends: users
104-
sql: >
105-
SELECT * FROM {users.sql()} WHERE type = 'student'
106-
```
107-
10893
```javascript
10994
cube(`teachers`, {
11095
extends: users,
@@ -125,11 +110,9 @@ cube(`students`, {
125110
});
126111
```
127112

128-
</CodeTabs>
129-
130113
<ReferenceBox>
131114

132-
Currently, `{cube.sql()}` is not supported in YAML data models.
115+
Currently, [`{cube.sql()}` function][ref-cube-sql-func] is not supported in YAML data models.
133116
Please [track this issue](https://github.com/cube-js/cube/issues/7484).
134117

135118
As a workaround, you can use JavaScript data models, put a SQL query in a
@@ -180,3 +163,5 @@ cube(`lessons`, {
180163
[ref-schema-advanced-extend]:
181164
/product/data-modeling/concepts/code-reusability-extending-cubes
182165
[ref-schema-ref-cubes-extends]: /reference/data-model/cube#extends
166+
167+
[ref-cube-sql-func]: /product/data-modeling/syntax#cubesql-function

docs/pages/product/data-modeling/syntax.mdx

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,69 @@ LEFT JOIN contacts "contacts"
539539
ON "users".contact_id = "contacts".id
540540
```
541541

542+
### `{cube.sql()}` function
543+
544+
When defining a cube, you can reference the `sql` parameter of another cube,
545+
effectively reusing the SQL query it's defined on. This is particularly useful
546+
when defining [polymorphic cubes][ref-polymorphism] or using [data blending][ref-data-blending].
547+
548+
Consider the following data model:
549+
550+
```javascript
551+
cube(`organisms`, {
552+
sql_table: `organisms`
553+
})
554+
555+
cube(`animals`, {
556+
sql: `
557+
SELECT *
558+
FROM ${organisms.sql()}
559+
WHERE kingdom = 'animals'
560+
`
561+
})
562+
563+
cube(`dogs`, {
564+
sql: `
565+
SELECT *
566+
FROM ${animals.sql()}
567+
WHERE species = 'dogs'
568+
`,
569+
570+
measures: {
571+
count: {
572+
type: `count`
573+
}
574+
}
575+
})
576+
```
577+
578+
If you query for `dogs.count`, Cube will generate the following SQL:
579+
580+
```sql
581+
SELECT count(*) "dogs__count"
582+
FROM (
583+
SELECT *
584+
FROM (
585+
SELECT *
586+
FROM organisms
587+
WHERE kingdom = 'animals'
588+
)
589+
WHERE species = 'dogs'
590+
) AS "dogs"
591+
```
592+
593+
<ReferenceBox>
594+
595+
Currently, `{cube.sql()}` function is only supported in JavaScript data models.
596+
It is not supported in YAML data models.
597+
Please [track this issue](https://github.com/cube-js/cube/issues/7484).
598+
599+
As a workaround, you can use JavaScript data models, put a SQL query in a
600+
[Jinja](/product/data-modeling/dynamic/jinja#jinja) variable, or load it from
601+
the [template context](/reference/python/cube#templatecontext-class).
602+
603+
</ReferenceBox>
604+
542605
### Non-SQL references
543606

544607
Outside [SQL expressions][self-sql-expressions], `column` is not recognized
@@ -629,3 +692,5 @@ defining dynamic data models.
629692
[ref-default-granularities]: /product/data-modeling/concepts#time-dimensions
630693
[ref-custom-granularities]: /reference/data-model/dimensions#granularities
631694
[ref-style-guide]: /guides/style-guide
695+
[ref-polymorphism]: /product/data-modeling/concepts/polymorphic-cubes
696+
[ref-data-blending]: /product/data-modeling/concepts/data-blending

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.1.4",
2+
"version": "1.1.6",
33
"npmClient": "yarn",
44
"useWorkspaces": true,
55
"packages": [

packages/cubejs-api-gateway/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.1.5](https://github.com/cube-js/cube/compare/v1.1.4...v1.1.5) (2024-11-13)
7+
8+
**Note:** Version bump only for package @cubejs-backend/api-gateway
9+
10+
11+
12+
13+
614
## [1.1.4](https://github.com/cube-js/cube/compare/v1.1.3...v1.1.4) (2024-11-12)
715

816

0 commit comments

Comments
 (0)