
Custom primary keys for nested data
When unnesting data, you may need more complex tooling to ensure correct aggregation. This is that complex tooling.
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
slid in for round two. I took a little break so I could switch branches. And this one's quick. Um I've been banging my head uh on this other um you know all the the branch shared extension stuff that I've been that I showed. And uh kind of this week an ask came in from uh from our solutions engineers team and it kind of like took me back to like the early days of of uh you know like when I first started Omni there was like very much and I think it still exists but it's felt a little since I've been working on these larger projects like oh it's harder to do kind of like interrupt you like oh this would be really nice can we
just do this and this one sounded very achievable. uh and fun. And so uh when I had my my my branch stuff that I showed uh in a decent state to to wait, I went ahead and like took the afternoon to build this. So the the context is basically in the UI we have this ability to build quick as but um certain aggregate functions need to have a custom primary key in particular if they're built on top of like a strruct um that might cause fan out by referencing the strct.
And so um what I've done is I've added a new parameter to dimensions called what did I call it? Uh custom primary key SQL for quicks. That's a mouthful. Uh we could change it but um you know whatever it is. Actually first name isn't a unique key but for the purposes of the demo it doesn't matter. Uh so we just put first name as the custom primary key SQL.
If I now jump into a new analysis, um, okay. Well, that's annoying. Did I lose O again? Cuz it was weird. I lost O. It could be that my internal DB now is in a weird state because I'm jumping between branches and showing stuff off. So, I'll have to um I'll get this shipped next week and and we'll do another demo to actually show the the full piece.
But uh the the the TLDDR is you add this to a dimension then if you build a quick aggregate on top of that dimension it will populate that custom SQL custom distinct key on the SQL um that a quick question is there anything that will autogenerate this as we do sort of unnsting or not really that I I mean I think that would be a follow on thing to like kind of do a a piece where we say, "Oh, you're building an unnest.
Let's go figure out what." But it's I mean that's a non-trivial problem, right? Yeah. I have to collect various things and do a count just you know like count grouped by each of the different things and find one where the count never exceeds one or something like that. So it's not a there's probably something that we could do to make that automatic.
Um but no, this is definitely not that. This is more like the modeler can go and set up any already extracted strcts so that if anybody then adds a quick aggregate to one of those strcts, it's not going to cause fan out and confusion. to for context on this one. Um, we requested this for a customer Wednesday morning for for like product office hours and now Conrad's already like demoing it to ship next week, which is just absurd as far as like how fast we build.
Um, and we're going on site with this with this customer on Monday. So, yeah, it's really really really appreciated on this one. Yeah. Well, and I mean the whole thing about like why I kind of framed the beginning of the demo of that is just like that's one of the things that I've loved about working at Omni since I joined is like we have the the autonomy to make decisions to go and do things and ship fast and do an interrupt because the the time to value on it feels right and and it's just so fun.
And so like going and doing this like thanks Justin for bringing this forward is something that is has value and like it it kind of reinvigorated me around some of that that what has made my time so far here special and we'll keep making it special. So awesome. Great. Thanks for the shout out. Yeah. Rio.