Skip to content

Problem with “Polymorphic cubes” #7913

@thePermission

Description

@thePermission

Hey Guys, i try to follow:
https://cube.dev/docs/product/data-modeling/concepts/polymorphic-cubes
and
https://cube.dev/docs/product/data-modeling/concepts/code-reusability-extending-cubes

But i get the feeling there is some issue with defining sql and sql table
With a Cube like this:

cubes:
  - name: users
    sql_table: users

i cant write cubes like this:

cubes:
  - name: teachers
    extends: users
    sql: >
      SELECT * FROM {users.sql()} WHERE type = 'teacher'
 
  - name: students
    extends: users
    sql: >
      SELECT * FROM {users.sql()} WHERE type = 'student'

it will cause the error
You must use either sql or sqlTable within a model, but not both

Metadata

Metadata

Assignees

Labels

data modelingdocsIssues that require a documentation improvementquestionThe issue is a question. Please use Stack Overflow for questions.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions