You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, compiled nodes store some information on them that varies based on node type (compiled test nodes have all the same fields, so ignore the differences between them for now):
extra_ctes: This is changed during ref resolution (which happens in the "runtime" context, while compiled_sql is being created). Refs to ephemeral nodes are turned into appends on this array.
extra_ctes_injected: This is always False until extra_ctes has been processed during compilation.
compiled_sql: This is None at first, and then is rendered from the runtime context and the raw_sql.
compiled: This is always True if compiled_sql is a value, and False if it's None. This should be a property, if it even exists.
injected_sql: This is None at first, and is built from compiled_sql + extra_ctes (+ extra_ctes_injected, but that's just bookkeeping)
wrapped_sql: This is intially None on all nodes, and on data tests is 'select (count*) from (\n{injected_sql}\n) sbq'. For schema tests and hooks, it is just set to the same as wrapped_sql. Finally, all values of wrapped_sql are passed through rendering. So None becomes 'None'.
I propose we change this so that only the current wrapped_sql (for data tests) and injected_sql (for everything else) is included, under the name compiled_sql, and make everything use that. During compilation we should use a wrapper type of some sort that holds the extra bookkeeping information, instead of attaching that to the actual node spec. We can also remove the cte-related methods from the CompiledNode object, which seems good.
Who will this benefit?
Developers, people looking at the manifest
The text was updated successfully, but these errors were encountered:
we should also write accompanying documentation for the various "states" a node can be in -- before this, "parsed", "compiled", "injected", "wrapped" were valid states though the intermediate states ("compiled", "injected") were not actually useful. "parsed", "compiled" seems like a better set of states
With the removal of injected_sql in favor of overwriting compiled_sql (#2762), and standardizing the artifact schemas in v0.19.0, I think we've accomplished the spirit of this issue.
We're still overdue to document the distinction between a node being parsed vs. compiled.
Feature
Clean up the compilation process and remove compilation artifacts from the results
Feature description
This is an add-on for #1589.
Currently, compiled nodes store some information on them that varies based on node type (compiled test nodes have all the same fields, so ignore the differences between them for now):
compiled_sql
is being created). Refs to ephemeral nodes are turned into appends on this array.None
at first, and then is rendered from the runtime context and theraw_sql
.True
ifcompiled_sql
is a value, andFalse
if it'sNone
. This should be a property, if it even exists.None
at first, and is built fromcompiled_sql
+extra_ctes
(+extra_ctes_injected
, but that's just bookkeeping)None
on all nodes, and on data tests is'select (count*) from (\n{injected_sql}\n) sbq'
. For schema tests and hooks, it is just set to the same aswrapped_sql
. Finally, all values ofwrapped_sql
are passed through rendering. SoNone
becomes'None'
.I propose we change this so that only the current
wrapped_sql
(for data tests) andinjected_sql
(for everything else) is included, under the namecompiled_sql
, and make everything use that. During compilation we should use a wrapper type of some sort that holds the extra bookkeeping information, instead of attaching that to the actual node spec. We can also remove the cte-related methods from theCompiledNode
object, which seems good.Who will this benefit?
Developers, people looking at the manifest
The text was updated successfully, but these errors were encountered: