-
Notifications
You must be signed in to change notification settings - Fork 560
Support ARRAY data type #10742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
<
8000
a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/TuringLovesDeathMetal/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/TuringLovesDeathMetal">@TuringLovesDeathMetal Let me share another possible idea inspired by Looker instead of supporting the ARRAY data type. It seems that Looker allows to join ARRAY field by using the
https://cloud.google.com/looker/docs/best-practices/how-to-model-nested-bigquery-data-in-looker
|
This issue was mentioned by a user in slack: https://lightdash-community.slack.com/archives/C03MG2VTR08/p1732728331734719?thread_ts=1732728331.734719&cid=C03MG2VTR08 |
This issue was mentioned by a user in slack: https://lightdash.slack.com/archives/C05UPNC0LGP/p1734374612987889?thread_ts=1734374612.987889&cid=C05UPNC0LGP |
This issue was mentioned by a user in slack: https://lightdash.slack.com/archives/C07UA0AC2G2/p1736508486487049?thread_ts=1736508486.487049&cid=C07UA0AC2G2 |
This issue was mentioned by a user in slack: https://lightdash.slack.com/archives/C07UA0AC2G2/p1732536712367539?thread_ts=1732536712.367539&cid=C07UA0AC2G2 |
requested by a prospect |
Description
I would like Lightdash to support ARRAY data type.
That would help us not to create additional models and can calculate some types of metrics.
sum distinct
#4329What problem does this solve?
Duplication of rows prevents us from calculating some types of metrics on Lightdash.
If Lightdash supports ARRAY data type, we don't need to additional models and can calculate some types of metrics.
As far as I know, there are two main approaches to get ARRAY data available in Lightdash.
However, in either case, we can't calculate the sum of a column in one model.
Let's consider if we have a BigQuery table which has a ARRAY field.
We call it the
original_table
source.id
: INT (unique key)name
: STRINGamount
: INTitems
: ARRAY of STRINGIn the first approach, we can expand the
items
ARRAY into multiple rows.The expanded model has duplicated rows on
id
columns.If we want to calculate the sum of
amount
column over uniqueid
s on Lightdash, we can't do it because theid
column are duplicated.In the second approach, we can create another model only with unique
id
anditems
ARRAY.Then, we join the
original_table
with theexpanded_tags
model onid
column with theWe can calculate the sum of
amount
column over uniqueid
s on Lightdash, if we don't use any field ofitems
ARRAY.However, if we want to filter rows by element of
items
ARRAY, we can't do it because the joined data has duplicated rows.That might be confusing for users.
The text was updated successfully, but these errors were encountered: