
Dynamic dbt schemas (schema switching)
Dynamic dbt schemas: Often developers are working across one or many dbt schemas for new transformations. Omni can now gracefully move developers between schemas in branches to test changes…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
been some mention of DBT so I'll piggy back off of that to do my demo just one second while I find the right window okay so um yeah this uh what I have to show you is a culmination of a few weeks of work it's pretty much all in the back end and so the front end that you see is fairly minimal um but the goal of what's going on is that we want people to be able to uh model against queer against DBT in such a way that they can uh have a development workflow so when you're sort of in normal mode you're pulling data from production but you might be making a change to your DBT models which results in like new tables
or changes to tables and the way that people do that is by uh well very often the way that they do that is by having separate schemas inside their production Warehouse that hold all of their development models um so you can see I have that mimicked here where I have these DBT prod this DBT prod schema this DBT prod sales schema but then there's this DBT Buck sales and DBT buck and those are uh copies of the prod stuff but for my development workflow and if I open that you can see that I've made it so that there's an extra table in my Dev schema and in prod there's a different table that doesn't exist in my Dev schema and what we're working on is
uh uh well I'll just show you so uh there's this new syntax in the model that you can specify what your target schema is for uh for the what you would call the production model and um by that existing we now create this Omni DBT and Omni DBT sales schema which are virtual schemas they're similar to Dynamic schemas that Conrad built it's built all on top of the dynamic schema stuff um so these are schemas that will uh because you're pointing to prod here these are all going to point to prod so if you now run queries against uh this Omni DBT schema any of these views inside of it they're going to be pulling from the production version um and that way you can
like build references on top of this omn DBT schema and om DBT is never going to change so now if I make a branch and I can change this now to DBT Buck you'll see that uh this schema stays the same that prod specific table just dropped out and now we have a Dev one these other ones that are the same between uh Dev and prod are unchanged uh and so uh we can query against the stuff and you can see that this query on this branch is pulling from Dev I have like modified the data so that DBT Dev is in the data if I exit the branch and run the query again now it's pulling from prod um so that's the sort of
the full end end what's going on there uh hopefully all that made sense there's a lot of like DBT specific stuff um but if it didn't make sense anybody let me know is is the vision then that people would build their data model on essentially the Omni DBT schema rather than the individual schemas themselves yes okay and that way everything will just seamlessly point to pull from the underlying Dev tables once they've switched to a branch and they can run content validation that's all going to like check that things work and then once they promote um the idea is that uh it's broken right now my Branch but if I were to promote this uh it would not promote this value and it would retain
the branch in your non- branch model makes sense so that's one for the field team to think about as we like recommend architectures for stuff for what it's worth um just on that mention Megan and I talked to some folks at Quizlet yesterday who are pretty DBT heavy shop uh the data engineering team there and we were mentioning that buck was actually working on this I didn't expect to see it today which is awesome but they were pretty stoked on uh the idea of this this sounded like something they would definitely have have a use case for uh bu quick question what uh again you may have done this the beginning but what uh caused that the Omni DBT like virtual schema to show up
is it when you add this parameter into the model that it then creates that or what what triggers this yeah adding this in will trigger it to be created and it's going to search uh so yeah there's one um important thing to point out there which is um if you go into a branch and you add a brand a schema that's not um a DBT schema like DBT buck that hasn't been used before you will also have to run a refresh schema from within this branch which will like run DBT syncing process for this Branch um so another detail you might see is uh if I go into one of these things that has some metadata being pulled in um you get DBT info for
this development schema now um and it will also exists for the prod one you can see that the target scheme was DBT prod and so you got information for both Dev and prod stuff in here um but yeah to your original question the presence of this is what triggers these to be created and my thought is that we may want to right now you have to configure the target schema in your connection settings um we may want to just maybe remove it only have it in the model or maybe have changes to the connection settings automatically update this you know it's kind of duplicated data now so how exactly those play together is a TBD and then ISE I was just gonna ask real quick
is is there a way like once you do have this now the Omni DBT virtual to like I guess maybe you want this maybe you don't to like hide the underlying DBT ones to clear up the that's exactly what I was gonna want to get gonna get to uh Ariel is that most likely if you're utilizing this functionality you'll want to do something like ignored schemas uh DBT unor star or something like that and and that will then uh make it so that you don't accidentally model against kind of the source schemas but you're modeling against the omn schema Buck related to the duplicative um schema parameter um is there a reason why it has to live in the model at all could it just
live on the connection I just noted that I know you had to jump through some hoops to not like you know allow it to be merged and so forth which maybe suggest to me that it's a little bit of an awkward thing to have in the model yeah I mean so there's two things there one is there there is a discussion that um Conrad brought up that I'm going to revisit once I got the basic functionality down around like do you want to sometimes merge this or give the user control to say to merge it if you were uh that use case I guess is a separate discussion um ultimately the reason for putting it in the model was a bit of a uh technical
difficulty in that where we're doing the model merging we don't have access to outside bits of information the easiest thing to do is if there's data that's attached to the model itself um it could be like a separate uh bit of data that's on the model record in the database that maybe is not part of what you see in edit um but actually just having it part of the model data structure made it so that we don't have to refactor like a huge huge uh amount of the back end