-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[CT-2348] [Feature] dbt clone
command
#7256
Comments
dbt clone
commanddbt clone
command
This is really cool, and could immediately see it useful to us as we're just migrating from Redshift to Snowflake! I was reading this where it inferred that its much fast faster to copy individual tables over copying databases: https://select.dev/posts/snowflake-clones As we're looking at manifest.json, I'm assuming that's what you're doing anyways underneath the hood, and leveraging tonnes of threads? |
@pratik60 Exactly right, on all counts! To get a sense for feasibility, and identify risks, I've drafted a first stab in #7258. I dropped a whole bunch of questions inline. Most of the questions are around technical implementation decisions, rather than the product/user experience, so I think it's appropriate to start chatting about this with more folks. |
Per BLG 4/1/23 |
Separate tickets for each adapter makes sense! We can do that as part of fleshing out the epic tasklist (#7301) It might make sense to dig into the comments/questions I left in #7258 to understand other ways we'd want to break this down. I'm perfectly happy if we use that draft PR as proof of feasibility, and to align on where the gotchas are here — and then throw all the code away and start fresh. |
I can't wait to throw this demo away in favor of this native feature: https://www.loom.com/share/bcfd2cf3b4b5471683bfc5b24587db3d Let me know how I can help. Got a reference jinja macro in there too! |
We need to talk about MVs in that context. Sorry I'm just planting a flag at the moment >< |
@Fleid on discutera dans 3 minutes :) |
Is this your first time submitting a feature request?
Describe the feature
Big idea: Clone my production state into my development schema, please!
Implementation details:
--defer
. Using the--state
manifest, but actually create zero-copy clones/pointers to the "prod" versionscreate or replace table ... clone
, use it!select * from {prod_version}
--full-refresh
Describe alternatives you've considered
Previously, I had thought (& written) that this should happen as part of
dbt run --defer
, as another deferral mode (instead of rewriting upstream references).But I think that "cloning" should support node selection, too. I don't think there's a nice way to implicitly clone unselected resources and build selected resources, even if it's the ultimate UX we want to achieve.
Instead, you could do something like:
Who will this benefit?
Anyone who wants to avoid rerunning lots of models in dev/CI — but who still want to have a "full" dev/CI schema, with a pointer/clone of every relational object, in order to hook up to downstream querying (e.g. BI)
Are you interested in contributing this feature?
I'll push up a draft, and we can start some conversation there :)
Anything else?
Lengthy previous discussion in:
Specifically, from #5095 (comment):
Except, what if it actually didn't? And the pseudo-command I wrote above, back in December, is exactly how it should work? :)
The text was updated successfully, but these errors were encountered: