cube-js / cube-js/cube

Automatic Casting to Float64 in Where clause Filters for Numeric Dimensions (Causing Clustering problems)

Open
#10,083 5 comments 0 reactions 0 assignees View on GitHub
driver:bigquery
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Problem**

Hi, is there any way to make sure that dimensions with type: number get converted to int instead of float or is there any way to disable automatic casting?

**Related Cube.js schema**
```javascript

org_id: {
sql: org_id,
type: number,
},

time_period_id: {
sql: time_period_id,
type: number,
},

```

These dimensions generate SQL like this:

**Related Cube.js generated SQL**

```sql
AND (fact.org_id = CAST(4 AS FLOAT64)) AND (fact.time_period_id = CAST(108 AS FLOAT64))
```

Since my columns are in integer it breaks my clustering optimization when wrong casting is happened.

Thanks

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.