cube-js / cube-js/cube

[Feature request] Unnest array support

Open
#8,280 0 comments 0 reactions 1 assignee Claimed by @igorlukanin View on GitHub
docs
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

Hi! We use BigQuery and work with arrays.

We try to define models such as:

```
cube('a', {
sql: `unnest(metrics)`,
...
});
```

```
cube('b', {
joins: {
a: {
relationship: 'one_to_many',
sql: `(true)`
}
},
...
});
```

The generated SQL looks like:

```LEFT JOIN (unnest(metrics)) AS a ON (true)```

and BigQuery throws an error:

```Expected keyword JOIN but got ")" at [5:37]```

Feature request: Add a check if the SQL is unnest(..) and do not wrap it with additional brackets.

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.