dbt should have a Dry-Run mode #4456
Replies: 28 comments 6 replies
-
So, I took a look at I can see that the In case it's helpful to see where my head is going, the way I've implemented this in the past is to have two functions for executing SQL. One for commands (no results returned) and one for queries (returning data) -- this way your read and write operations are split. Then, for the dry-run mode, you can put some logic in the command-handling function that just logs the command instead of passing it to
|
Beta Was this translation helpful? Give feedback.
-
yes, I vote to have the dry-run feature, which will be super helpful for debug and performance tuning |
Beta Was this translation helpful? Give feedback.
-
@cmcarthur What's the reasoning for this to be removed from the milestone? |
Beta Was this translation helpful? Give feedback.
-
Hi @thalesmello - this is a pretty involved change to dbt! Connor and I tried to prioritize it for the Wilt Chamberlain release (0.14.0), but we ended up deciding to cull it in favor of Archive-related functionality. This feature is definitely going to be a big improvement to dbt - I'm looking forward to re-prioritizing it! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation @drewbanin 👍 |
Beta Was this translation helpful? Give feedback.
-
+1 as well to adding a dry run feature such as a |
Beta Was this translation helpful? Give feedback.
-
Any movement on this? |
Beta Was this translation helpful? Give feedback.
-
Hello everyone! |
Beta Was this translation helpful? Give feedback.
-
@giovanni-girelli-sdg To see the actual SQL that dbt will execute you can use |
Beta Was this translation helpful? Give feedback.
-
Hi @alepuccetti! thanks for the reply, but there you can only see the SELECT statement. What I'd like to see is the actual SQL that will run, such as a MERGE, INSERT or CREATE statement. Edit at least it's what I can find. Is there a way to see the full materialization code? Edit2: I had not seen the target/run folder, that's enough for debugging in DEV. I still think it would be great to be able to have a dry run mode where no sql is actually executed, but I can see how that would be much harder to do. Thanks for the great work! |
Beta Was this translation helpful? Give feedback.
-
@mikekaminsky you opened this on my birthday! |
Beta Was this translation helpful? Give feedback.
-
+1 to this, especially if it allowed the calculation of the cost of the run, and allowed prevention of the run if the cost was too high unless a --force argument was used. |
Beta Was this translation helpful? Give feedback.
-
The more I think about it, the less I think this is possible. There are way
too many macros and materializations requiring active database querying to
determine the flow - you can't keep it completely dry.
…On Thu, May 27, 2021 at 4:40 PM Flavio Clesio ***@***.***> wrote:
+1
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1059 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANQZGB4JYSUUU5QJQSHCX6DTPZKV7ANCNFSM4F3KU4HQ>
.
--
*Giovanni Girelli*
Specialist
Advanced Business Analytics
SDG Consulting Italy
Viale del Lavoro 33, 37135 Verona - Italy
Mail : ***@***.*** - Mobile: +39 349 1045527
Website <http://www.sdggroup.com/it> | LinkedIn
<https://www.linkedin.com/company/sdg-group> | Twitter
<https://twitter.com/sdggroup> | YouTube
<https://www.youtube.com/user/sdggroup> | Facebook
<https://www.facebook.com/SDGGroup>
|
Beta Was this translation helpful? Give feedback.
-
For some reason when searching for this I found #281 but not this issue. I'm posting about it here with the link so that a reference will show up on the old PR, in case someone else finds the old PR. |
Beta Was this translation helpful? Give feedback.
-
it will be very useful to get runtime sql with |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, this is what I came up with locally, which extracts the In this case
poetry run dbt compile --select your_model \
&& jq -r '.nodes."model.your_project.your_model".config.sql_header' < target/manifest.json > tmp.sql \
&& cat target/compiled/your_project/models/your_directory/your_model.sql >> tmp.sql \
&& clipboard tmp.sql |
Beta Was this translation helpful? Give feedback.
-
This would be useful for our dbt dry runner which evaluates wether a dbt project will be run. We had to get around not having the full |
Beta Was this translation helpful? Give feedback.
-
I've logged a similarly-named-but-different proposal proposal here, FYI: Difference in that proposal is to still allow all the code to "execute" or "compile" in the SQL backend, but to do so without the cost of moving or transforming data. |
Beta Was this translation helpful? Give feedback.
-
+1 for DryRun! |
Beta Was this translation helpful? Give feedback.
-
+1 to fully understand the plan details of the |
Beta Was this translation helpful? Give feedback.
-
+1 for dry run. I hosed a prod database during a dbt migration today because dbt redshift 1.6 didn't render my custom schemas as expected. A command to validate my schemas are correct before building would have saved me a lot of time. |
Beta Was this translation helpful? Give feedback.
-
+1 for dry run. |
Beta Was this translation helpful? Give feedback.
-
+1 for dry run |
Beta Was this translation helpful? Give feedback.
-
+1 for dry run |
Beta Was this translation helpful? Give feedback.
-
for those that haven't seen, in v1.8 there is the |
Beta Was this translation helpful? Give feedback.
-
DBT should have a dry-run mode
Feature description
DBT should have a dry-run mode so that users can see all of the "commands" DBT will run for a given command without having DBT actually execute those commands against a database.
Who will this benefit?
This can be useful for both debugging as well as making sure that a given command is configured properly. This is especially useful when you're configuring a production setup and want to make sure you're not about to drop schemas or tables you didn't intend to.
It can also be useful for testing macros and other DBT configurations that are post-compilation but don't show up in the compiled SQL
Beta Was this translation helpful? Give feedback.
All reactions