cube-js / cube-js/cube

Data model generation with postgres and numeric types

Open
#8,149 2 comments 0 reactions 0 assignees View on GitHub
driver:postgres help wanted
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

Hi cube.js devs!

Using cube version 0.35.6, I am traying to generate a model for a postgres database using the playground. When generating model for tables with numeric types, ie:

```
onln=# \d acm_coin_in_statistics2
Table "public.acm_coin_in_statistics2"
Column | Type | Collation | Nullable | Default
-----------------------+--------------------------+-----------+----------+---------
device_id | numeric(10,0) | | not null |
game_id | numeric(5,0) | | not null |
statistics_date | timestamp with time zone | | not null |
hour_00 | numeric(10,0) | | |
hour_01 | numeric(10,0) | | |
...
Indexes:
"acm_coin_in_statistics2_pk" PRIMARY KEY, btree (device_id, game_id, statistics_date)
```

dimension for numeric values are generated as strings and primary key is not extracted correctly. If I use other data types (for example, integer, everithing works fine)

```
cubes:
- name: acm_coin_in_statistics
sql_table: public.acm_coin_in_statistics
data_source: default

joins: []

dimensions:
- name: game_id
sql: game_id
type: string

- name: device_id
sql: device_id
type: string

- name: statistics_date
sql: statistics_date
type: time

- name: hour_02
sql: hour_02
type: string

- name: hour_01
sql: hour_01
type: string
```

Is this the expected behaviour of the current version?

Thank you in advance!
Miguel

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.