cube-js / cube-js/cube

Issue with FILTER_GROUP (RangeError: Maximum call stack size exceeded)

Open
#9,173 3 comments 0 reactions 1 assignee Claimed by @igorlukanin View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 10h
Merged PRs (30d)
203

Description

Hi! When we use FILTER_GROUP in measures, we get a RangeError: Maximum call stack size exceeded.

Model:
```javascript
cube(`test`, {
sql: `select 1 as value, '1' as name`,

measures: {
metric: {
sql: `value`,
type: `avg`,
filters: [
{ sql: `${CUBE}.name = ${FILTER_GROUP(FILTER_PARAMS.test.name.filter((kpi) => kpi))}` }
],
},
},

dimensions: {
name: {
sql: `name`,
type: `string`
},
value: {
sql: `value`,
type: `number`
}
},
});
```

Query:
```json
{
"dimensions": [
"test.name",
"test.value"
],
"measures": [
"test.metric"
],
"filters": [
{
"values": [
"1"
],
"member": "test.name",
"operator": "equals"
}
]
}
```

Without FILTER_GROUP with FILTER_PARAMS... AND FILTER_PARAMS... .... works fine.

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.