TobikoData / sqlmesh

Efficient data transformation and modeling framework that is backwards compatible with dbt.
https://sqlmesh.com
Apache License 2.0
1.81k stars 160 forks source link

Better Debugging: Pretty SQL Rendering for dry runs in terminal #3096

Open sungchun12 opened 2 months ago

sungchun12 commented 2 months ago

https://github.com/TobikoData/sqlmesh/issues/2935 https://github.com/TobikoData/sqlmesh/issues/3086#issuecomment-2329693944

The goal is to run a command like this: sqlmesh plan --dry-run-render to view pretty SQL rendering in DAG order including all the DDL/DML/pre statements/post statements.

This prevents the need to context switch to query history and break immersion in the sqlmesh workflow.

image

giovannipcarvalho commented 2 months ago

Related #1254?

sungchun12 commented 2 months ago

This would also be helpful as debug logs while the sqlmesh run or sqlmesh plan command is running so it's clear where the sqlmesh steps failed as getting a query engine specific error message doesn't immediately tell me where it failed. This will also build clarity when "physical tables are being created" for views which don't have any physical data so people don't get confused in the terminal when they see that progress bar.