Skip to content

Join path in preaggregations #9212

@thePermission

Description

@thePermission

Is your feature request related to a problem? Please describe.
I have a datamodel where i can have a cube A, cube B and cube C. Cube A can join to cube B, cube B can join to cube C and cube A can also join to cube C. There is currently no way to define a preaggregation that joins cube A over cube B to cube C instead of directly joining cube A to cube C, except of extending cube A, cube B and cube C and only define the wanted join path. That leads to many exentions of cubes.

Describe the solution you'd like
I want to be able to define a join path in a preaggregation like the following example. (A pre_aggregation doesnt even need to be part of a cube, does it?)

cubes:
  - name: cubeA
    sql_table: cubeA
  
    joins:
      - name: cubeB
        relationship: many_to_one
        sql: "{CUBE.cubeB_id} = {cubeB.id}"
      - name: cubeC
        relationship: many_to_one
        sql: "{CUBE.cubeC_id} = {cubeC.id}"

  - name: cubeB
    sql_table: cubeB
  
    joins:
      - name: cubeC
        relationship: many_to_one
        sql: "{CUBE.cubeC_id} = {cubeC.id}"

pre_aggregations:
  - name: cubeAandC
      cubes:
      - join_path: cubeA
        dimensions:
          - dimension1
        measures:
          - measure1
      - join_path: cubeA.cubeB.cubeC
        dimensions:
          - dimension2
        measures:
          - measure2

Or i want to use a view and configure it to be preaggregated. Thats beeing said, its probably not possible or pretty hard to reuse this pre_aggregation for multiple views, but it would probably still find its usecases and makes it easy to figure out if a pre_aggregation can be used to a query for this view. Example:

views:
  - name: CubeA_and_CubeC_View
 
    cubes:
      - join_path: cubeA
        includes:
        - dimension1
        - measure1
      - join_path: cubeA.cubeB.cubeC
        includes:
          - dimension2
          - measure2

    preAggregation:
      - name: cubeA_and_cubeC_preagg
        includes: "*"
        time_dimension: cubeA.dimension1
        granularity: day

Describe alternatives you've considered
Extending cube A and only define a join to cube C directly

Metadata

Metadata

Assignees

Labels

pre-aggregationsIssues related to pre-aggregations

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions