cube-js / cube-js/cube

Internal: Error during planning: Coercion from [Int64Decimal(5), Int64]

Open
#6,881 8 comments 1 reaction 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

**Describe the bug**
I'm trying to query a cube from from playground and get an error.

The interesting point is that when i change granularity all works(added screenshots for comparison).

Works
```
{
"measures": [
"backoffice.in_out"
],
"timeDimensions": [
{
"dimension": "backoffice.as_of_date",
"granularity": "day",
"dateRange": "Yesterday"
}
],
"order": {
"backoffice.as_of_date": "asc"
}
}
```

Does not work

```{
"measures": [
"backoffice.in_out"
],
"timeDimensions": [
{
"dimension": "backoffice.as_of_date",
"granularity": "hour",
"dateRange": "Yesterday"
}
],
"order": {
"backoffice.as_of_date": "asc"
}
}

```

**To Reproduce**
Steps to reproduce the behavior:
1. Go to playground
2. select measures and time

**Expected behavior**

**Screenshots**
Screenshot 2023-07-13 at 13 20 15
Screenshot 2023-07-13 at 13 23 18

**Minimally reproducible Cube Schema**
my cube:

```javascript
cube(`backoffice`,
{
public: isPublic(`backoffice`, COMPILE_CONTEXT),
sql_table: `aggregate.backoffice`,
measures: {
deposit_amount_eur: {
sql: `deposit_amount_eur`,
type: `sum`
},
withdrawal_amount_eur: {
sql: `withdrawal_amount_eur`,
type: `sum`
},
in_out: {
sql: `1.0 * ${withdrawal_amount_eur} / NULLIF(${deposit_amount_eur}, 0)`,
type: `number`
},
},
dimensions: {
as_of_date: {
sql: `as_of_date`,
type: `time`
},
brand: {
sql: `brand`,
type: `string`
},
channel: {
sql: `channel`,
type: `string`
},
operator_id: {
sql: `operator_id`,
type: `string`
},
currency: {
sql: `currency`,
type: `string`,
format: `currency`
},
risk_business_segment: {
sql: `risk_business_segment`,
type: `string`,
},
player_uid: {
sql: `player_uid`,
type: `string`,
},
traffic: {
sql: `traffic`,
type: `string`,
},
},
dataSource: `default`
}
);
```

**Version:**
[e.g. 0.33.30]

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.