Skip to content

Dimensions with missing type in child cubes don't break data model compilation #8609

@igorlukanin

Description

@igorlukanin

Describe the bug
If a dimension definition doesn't have the type parameter, the data model would not compile, which is expected:

# THIS WOULD NOT COMPILE
cubes:
  - name: base_cube
    sql_table: foo

    measures:
      - name: count
        type: count

    dimensions:
      - name: baz
        sql: baz
        # NO TYPE HERE

However, if this dimension is a child cube that extends another one, the data model would compile:

# THIS WOULD COMPILE BUT IT SHOULD NOT
cubes:
  - name: base_cube
    sql_table: foo

    measures:
      - name: count
        type: count

  - name: child_cube
    extends: base_cube

    dimensions:
      - name: bar
        sql: bar
        # NO TYPE HERE

The dimension would appear in /meta without any type:

      "dimensions": [
        {
          "name": "child_cube.bar",
          "title": "Child Cube Bar",
          "shortTitle": "Bar",
          "suggestFilterValues": true,
          "isVisible": true,
          "public": true,
          "primaryKey": false
        }
      ],

Apparently, it would work with the REST API without issues.

However, running any queries against the SQL API, e.g., \d, would result in the following error:

ERROR:  missing field `type` at line 1 column 12227

To Reproduce
See above.

Expected behavior
Dimensions without type never compile.

Version:
0.35.73

Metadata

Metadata

Assignees

Labels

bugLEGACY. Use the Bug issue type insteaddata modeling

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions