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
25 changes: 15 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,17 @@ jobs:
strategy:
matrix:
node-version: [22.x]
os-version: ["macos-13"]
target: ["x86_64-apple-darwin", "aarch64-apple-darwin"]
python-version: ["3.9", "3.10", "3.11", "3.12", "fallback"]
include:
- target: x86_64-apple-darwin
os-version: macos-15-intel
package_target_arch: x64
package_target_platform: darwin
package_target_libc: unknown
tar_executable: gtar
- target: aarch64-apple-darwin
os-version: macos-14
package_target_arch: arm64
package_target_platform: darwin
package_target_libc: unknown
Expand Down Expand Up @@ -590,27 +591,31 @@ jobs:
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-gnu
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
# Please use minimal possible version of ubuntu, because it produces constraint on glibc
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
image: cubejs/rust-cross:x86_64-unknown-linux-gnu-15082024
executable_name: cubestored
strip: true
compress: false
- target: x86_64-unknown-linux-musl
os: ubuntu-24.04
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
image: cubejs/rust-cross:x86_64-unknown-linux-musl-15082024
executable_name: cubestored
strip: true
# cubestored: CantPackException: bad DT_HASH nbucket=0x344 len=0x1890
compress: false
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04
- os: ubuntu-24.04-arm
image: cubejs/rust-builder:bullseye-llvm-18
target: aarch64-unknown-linux-gnu
executable_name: cubestored
# Unable to recognise the format of the input file `rust/cubestore/target/aarch64-unknown-linux-gnu/release/cubestored'
strip: false
# UPX is broken, issue https://github.com/cube-js/cube/issues/4474
compress: false
fail-fast: false
container:
image: cubejs/rust-cross:${{ matrix.target }}-15082024
image: ${{ matrix.image }}
permissions:
contents: write
steps:
Expand All @@ -626,7 +631,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
prefix-key: v0-rust-cubestore-cross
prefix-key: v1-rust-cubestore-cross
key: target-${{ matrix.target }}
- name: Build with Cargo
run: |
Expand Down Expand Up @@ -678,7 +683,7 @@ jobs:
tar_executable: tar
# Please use minimal possible version of macOS, because it produces constraint on libstdc++
- target: x86_64-apple-darwin
os: macos-13
os: macos-15-intel
executable_name: cubestored
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
strip: false
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/rust-cubesql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,25 @@ jobs:
matrix:
# We do not need to test under all versions, we do it under linux
node-version: [22.x]
os-version: ["macos-14"]
target: ["x86_64-apple-darwin", "aarch64-apple-darwin"]
include:
- target: x86_64-apple-darwin
os-version: macos-15-intel
python-version: "3.9"
- target: x86_64-apple-darwin
os-version: macos-15-intel
python-version: "3.10"
- target: x86_64-apple-darwin
os-version: macos-15-intel
python-version: "3.11"
- target: x86_64-apple-darwin
os-version: macos-15-intel
python-version: "3.12"
- target: x86_64-apple-darwin
os-version: macos-15-intel
python-version: "fallback"
- target: aarch64-apple-darwin
os-version: macos-14
python-version: "fallback"
fail-fast: false

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/rust-cubestore-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
# cubestored.exe: CantPackException: superfluous data between sections
compress: false
# Please use minimal possible version of macOS, because it produces constraint on libstdc++
- os: macos-13
- os: macos-15-intel
target: x86_64-apple-darwin
executable_name: cubestored
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
Expand Down Expand Up @@ -264,16 +264,19 @@ jobs:
# Please use minimal possible version of ubuntu, because it produces constraint on glibc
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
image: cubejs/rust-cross:x86_64-unknown-linux-gnu-15082024
executable_name: cubestored
strip: true
compress: false
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
image: cubejs/rust-cross:x86_64-unknown-linux-musl-15082024
executable_name: cubestored
strip: true
# cubestored: CantPackException: bad DT_HASH nbucket=0x344 len=0x1890
compress: false
- os: ubuntu-22.04
- os: ubuntu-24.04-arm
image: cubejs/rust-builder:bullseye-llvm-18
target: aarch64-unknown-linux-gnu
executable_name: cubestored
# Unable to recognise the format of the input file `rust/cubestore/target/aarch64-unknown-linux-gnu/release/cubestored'
Expand All @@ -282,7 +285,7 @@ jobs:
compress: false
fail-fast: false
container:
image: cubejs/rust-cross:${{ matrix.target }}-15082024
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
Expand All @@ -296,7 +299,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
prefix-key: v0-rust-cubestore-cross
prefix-key: v1-rust-cubestore-cross
key: target-${{ matrix.target }}
- name: Build with Cargo
run: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/rust-cubestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
# cubestored.exe: CantPackException: superfluous data between sections
compress: false
# Please use minimal possible version of macOS, because it produces constraint on libstdc++
- os: macos-13
- os: macos-15-intel
target: x86_64-apple-darwin
executable_name: cubestored
# upx has been disabled because it is crashing for macOS Ventura or above! It was disabled on 2024-09-05.
Expand Down Expand Up @@ -203,16 +203,19 @@ jobs:
# Please use minimal possible version of ubuntu, because it produces constraint on glibc
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
image: cubejs/rust-cross:x86_64-unknown-linux-gnu-15082024
executable_name: cubestored
strip: true
compress: false
- os: ubuntu-22.04
target: x86_64-unknown-linux-musl
image: cubejs/rust-cross:x86_64-unknown-linux-musl-15082024
executable_name: cubestored
strip: true
# cubestored: CantPackException: bad DT_HASH nbucket=0x344 len=0x1890
compress: false
- os: ubuntu-22.04
- os: ubuntu-24.04-arm
image: cubejs/rust-builder:bullseye-llvm-18
target: aarch64-unknown-linux-gnu
executable_name: cubestored
# Unable to recognise the format of the input file `rust/cubestore/target/aarch64-unknown-linux-gnu/release/cubestored'
Expand All @@ -221,7 +224,7 @@ jobs:
compress: false
fail-fast: false
container:
image: cubejs/rust-cross:${{ matrix.target }}-15082024
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
Expand All @@ -235,7 +238,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
workspaces: ./rust/cubestore -> target
prefix-key: v0-rust-cubestore-cross
prefix-key: v1-rust-cubestore-cross
key: target-${{ matrix.target }}
- name: Build with Cargo
run: |
Expand Down
52 changes: 52 additions & 0 deletions docs/pages/product/data-modeling/reference/dimensions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,58 @@ cubes:

</CodeTabs>

### `order`

The `order` parameter specifies the default sort order for a dimension. Valid
values are `asc` (ascending) and `desc` (descending). This parameter is optional.

When set, the dimension's default sort order is exposed via
[APIs and integrations][ref-apis]. Consuming applications, such as BI tools
and custom frontends, can use this metadata to apply consistent default sorting
when displaying dimension values, ensuring a uniform user experience across
different tools connected to the semantic layer.

<CodeTabs>

```javascript
cube(`orders`, {
// ...

dimensions: {
status: {
sql: `status`,
type: `string`,
order: `asc`
},

created_at: {
sql: `created_at`,
type: `time`,
order: `desc`
}
}
})
```

```yaml
cubes:
- name: orders
# ...

dimensions:
- name: status
sql: status
type: string
order: asc

- name: created_at
sql: created_at
type: time
order: desc
```

</CodeTabs>

### `primary_key`

Specify if a dimension is a primary key for a cube. The default value is
Expand Down
7 changes: 7 additions & 0 deletions packages/cubejs-api-gateway/openspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ components:
type: "object"
format:
$ref: "#/components/schemas/V1CubeMetaFormat"
order:
$ref: "#/components/schemas/V1CubeMetaDimensionOrder"
V1CubeMetaDimensionOrder:
type: "string"
enum:
- "asc"
- "desc"
V1CubeMetaMeasure:
type: "object"
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type DimensionDefinition = {
fieldType?: string;
multiStage?: boolean;
shiftInterval?: string;
order?: 'asc' | 'desc';
};

export type TimeShiftDefinition = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export type CubeSymbolDefinition = {
granularities?: Record<string, GranularityDefinition>;
timeShift?: TimeshiftDefinition[];
format?: string;
order?: 'asc' | 'desc';
};

export type HierarchyDefinition = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export type DimensionConfig = {
primaryKey: boolean;
aliasMember?: string;
granularities?: GranularityDefinition[];
order?: 'asc' | 'desc';
};

export type SegmentConfig = {
Expand Down Expand Up @@ -274,6 +275,7 @@ export class CubeToMetaTransformer implements CompilerInterface {
origin: gDef.origin,
}))
: undefined,
order: extendedDimDef.order,
};
}),
segments: Object.entries(extendedCube.segments || {}).map((nameToSegment: [string, any]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ const BaseDimensionWithoutSubQuery = {
otherwise: formatSchema
}),
meta: Joi.any(),
order: Joi.string().valid('asc', 'desc'),
values: Joi.when('type', {
is: 'switch',
then: Joi.array().items(Joi.string()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Object {
"key": "Meta.key for CubeA.id",
},
"name": "simple_view.id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeA.id",
Expand All @@ -32,6 +33,7 @@ Object {
"key": "Meta.key for CubeB.other_id",
},
"name": "simple_view.other_id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeB.other_id",
Expand Down Expand Up @@ -114,6 +116,7 @@ Object {
"key": "Meta.key for CubeB.other_id",
},
"name": "simple_view.CubeB_other_id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeB.other_id",
Expand Down Expand Up @@ -196,6 +199,7 @@ Object {
"key": "Meta.key for CubeA.id",
},
"name": "simple_view.CubeA_id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeA.id",
Expand All @@ -213,6 +217,7 @@ Object {
"key": "Meta.key for CubeB.id",
},
"name": "simple_view.CubeB_id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeB.id",
Expand All @@ -230,6 +235,7 @@ Object {
"key": "Meta.key for CubeB.other_id",
},
"name": "simple_view.CubeB_other_id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeB.other_id",
Expand Down Expand Up @@ -312,6 +318,7 @@ Object {
"key": "Meta.key for CubeB.other_id",
},
"name": "simple_view.CubeB_other_id",
"order": undefined,
"primaryKey": false,
"public": true,
"shortTitle": "Title for CubeB.other_id",
Expand Down
Loading
Loading