-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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-1584] [Feature] New top level commands: interactive compile #6358
Comments
a compile by any other nameWhat do we think of creating this "interactive compile" as a modification / extension of the existing $ dbt compile --code "select * from {{ ref('my_model') }}" --no-allow-introspection
There are a few important ways in which this would be different from the Differences:
Similarities:
select * from {{ ref('changed_model_in_dev') }}
union all
select * from {{ ref('unchanged_model_in_prod') }} $ dbt compile --defer --state path/to/prod/artifacts/ --code "c2VsZWN0ICogZnJvbSB7eyByZWYoJ2NoYW5nZWRfbW9kZWxfaW5fZGV2JykgfX0KdW5pb24gYWxsCnNlbGVjdCAqIGZyb20ge3sgcmVmKCd1bmNoYW5nZWRfbW9kZWxfaW5fcHJvZCcpIH19" select * from dbt_jcohen.changed_model_in_dev
union all
select * from analytics.unchanged_model_in_prod re: manifestsIMO, we don't need to support a CLI
IMO this is not in scope for last but not leastAs part of this work, we should also deprecate the existing "sql tasks": https://github.com/dbt-labs/dbt-core/blob/main/core/dbt/task/sql.py |
Another consideration, not mentioned above: We should support interactive compilation of a specific model, within the context of that model, while still being able to skip over cache population. That will enable us to avoid this issue: dbt-labs/dbt-rpc#46 Think something like:
That model's compiled SQL should then be included in the logs, and possibly also "returned" from the method (?) if called directly / programmatically. |
for
|
Describe the feature(Updated Feb 9 after chatting with @aranke )
In
dbt-rpc
anddbt-server
, we support using some kind of manifest object(in mem object fordbt-rpc
andmanifest.msgpack
fordbt-server
) that regenerated whenever a dbt project file got modified to to support interactive compile.Here's the link of how it is done in
dbt-rpc
anddbt-server
For input options
One of the goals of creating such command is to get rid of the custom code we are doing in
lib.py
anddbt-server
, and have dbt-server go through a proper interface in dbt-core for this functionalities. There are two main options we want to support--allow-introspection/--no-allow-introspection
(name tbd)--in-line
(name tbd) option to allow user compile some code that's not attached to a specific modelin line
code supplied by user doesn't belong to a specific node in the current project, so we will have to create a temp node for it, resolve the ref/source/config, then do the compilation.(link){this}
probably will be wrongFor output
Other non functional requirement
The text was updated successfully, but these errors were encountered: