Let's say I have an array of info (ex: tags: ['red', 'blue', 'green']
) in my data. How would I add that to my cube(s) to do something like a filter on tags array contains
a particular value?
I'm specifically using the Athena driver with pre-aggregation into Aurora Postgres.
This is where I have gotten so far, but it's not quite there yet.
cube(`Events`, {
sql: `select * from events`,
joins: {
Tags: {
relationship: `hasMany`,
sql: `${tags}.id = ${tags}`
}
},
});
cube(`Tags`, {
sql: `UNNEST(tags) t (id, idx)`,
dimensions: {
tag: {
sql: `id`,
type: `string`
}
}
});