cube icon indicating copy to clipboard operation
cube copied to clipboard

Rollup Designer in Cube Core is broken for YAML data models

Open quy-ng opened this issue 2 years ago • 10 comments

Hi folks,

I had a question which I posted at https://forum.cube.dev/t/syntax-error-missing-semicolon-in-schema/598 and slack, regarding syntax error.

My schema file is

cubes:
  - name: AnalystProfiles
    sql: SELECT * FROM analyst_profiles
      # preAggregations:
      # Pre-Aggregations definitions go here
      # Learn more here: https://cube.dev/docs/caching/pre-aggregations/getting-started
    joins: []
    measures:
      - name: count
        type: count
        drillMembers: [firstName, gender]
    dimensions:
      - name: age
        sql: age
        type: number
      - name: firstName
        sql: first_name
        type: string
      - name: gender
        sql: gender
        type: string
    dataSource: default

And error log is Syntax error during 'AnalystProfiles.yaml' parsing: Missing semicolon. (2:8): - name: AnalystProfiles ^

Basically, my schema file was generated by cube, but when I got an error that was confusing to me. I wonder if anyone here has ever encountered this?

FYI, I am using latest version with Docker

quy-ng avatar Jan 11 '23 09:01 quy-ng

I am facing the same issue even using the example yaml orders.yml. @dongchirua have you figured out this issue? Thank you!

jasonyanwenl avatar Apr 26 '23 05:04 jasonyanwenl

This is the same for me. And this crashes cube as well:

cube_1           | Error: Cannot set headers after they are sent to the client
cube_1           |     at new NodeError (node:internal/errors:387:5)
cube_1           |     at ServerResponse.setHeader (node:_http_outgoing:644:11)
cube_1           |     at ServerResponse.header (/cube/node_modules/express/lib/response.js:771:10)
cube_1           |     at ServerResponse.send (/cube/node_modules/express/lib/response.js:170:12)
cube_1           |     at ServerResponse.json (/cube/node_modules/express/lib/response.js:267:15)
cube_1           |     at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:581:11
cube_1           |     at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:78:9
cube_1           | Error: Cannot set headers after they are sent to the client
cube_1           |     at new NodeError (node:internal/errors:387:5)
cube_1           |     at ServerResponse.setHeader (node:_http_outgoing:644:11)
cube_1           |     at ServerResponse.header (/cube/node_modules/express/lib/response.js:771:10)
cube_1           |     at ServerResponse.send (/cube/node_modules/express/lib/response.js:170:12)
cube_1           |     at ServerResponse.json (/cube/node_modules/express/lib/response.js:267:15)
cube_1           |     at /cube/node_modules/@cubejs-backend/server-core/src/core/DevServer.ts:82:25

My cube:

cubes:
  - name: c1_b1_raw_adult
    sql_table: c1.c1_b1_raw_adult
    data_source: default

    pre_aggregations:
      # Pre-aggregation definitions go here
      # Learn more here: https://cube.dev/docs/caching/pre-aggregations/getting-started

    joins: []

    measures:
      - name: count
        type: count

    dimensions:
      - name: age
        sql: age
        type: number

Proposed pre-aggregation:

name: main
measures:
  - c1_b1_raw_adult.count
dimensions:
  - c1_b1_raw_adult.age

Can happen because the model files is on a docker volume owned by a user on the host?

Cube v0.33.2

torshind avatar May 05 '23 09:05 torshind

Hi, I'm also facing the same issue. Was anyone able to work it out?

P-Arnold avatar Sep 06 '23 11:09 P-Arnold

Any update?

josephybh avatar Oct 01 '23 04:10 josephybh

Hey @josephybh @P-Arnold and everyone 👋

Which version of Cube are you using? Could you please try upgrading to the latest one?

I've checked this very source code with Cube v0.34 and it compiles and works perfectly for me:

cubes:
  - name: AnalystProfiles
    sql: SELECT * FROM analyst_profiles
      # preAggregations:
      # Pre-Aggregations definitions go here
      # Learn more here: https://cube.dev/docs/caching/pre-aggregations/getting-started
    joins: []
    measures:
      - name: count
        type: count
        drillMembers: [firstName, gender]
    dimensions:
      - name: age
        sql: age
        type: number
      - name: firstName
        sql: first_name
        type: string
      - name: gender
        sql: gender
        type: string
    dataSource: default

igorlukanin avatar Oct 04 '23 22:10 igorlukanin

i use the same v0.34 it is not working either

documentation is outdated, i manually configured this works. or it could be UI or api issues.

https://cube.dev/docs/reference/data-model/pre-aggregations

pre_aggregations:
  - name: orders_by_status
    dimensions:
      - CUBE.status
    measures:
      - CUBE.count

GomesNayagam avatar Oct 20 '23 21:10 GomesNayagam

If you are interested in working on this issue, please leave a comment below and we will be happy to assign the issue to you. If this is the first time you are contributing a Pull Request to Cube.js, please check our contribution guidelines. You can also post any questions while contributing in the #contributors channel in the Cube.js Slack.

github-actions[bot] avatar Jan 10 '24 02:01 github-actions[bot]

Hi guys, I also faced the same issue in v0.34.42 while I was following cube core tutorial. I even tried to use js format for data models, I still ran into parsing error because of example_view.yml.

yb9255 avatar Jan 12 '24 05:01 yb9255

Any update ?

whtblktone avatar Jun 05 '24 13:06 whtblktone