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
Is your feature request related to a problem? Please describe.
I'm still using snowddl-convert/singledb plan to generate sql to update a target Snowflake d/b to match our git repo. One of the problems I'm trying to solve is detecting when a CTAS statement implicitly drops a column, so I can flag the generated plan sql for human review/approval. It looks like, within TableResolver.compare_object() there is a variable, unsafe_alters that records the columns that are getting dropped (and probably some other stuff, too). It would make my problem case (column implicitly dropped by CTAS) easier to detect if the contents of that variable were emitted as a comment (ideally, one item per line), the same as replace_reasons.
Describe the solution you'd like
This, or something like it:
if replace_reasons:
replace_query = "\n".join(f"-- {r}" for r in replace_reasons) \
+ "\n" + "\n".join( f"-- {a}" for a in unsafe_alters) \ <------------------------- this
+ "\n" + str(self._build_create_table(bp, snow_cols))
Describe alternatives you've considered
Could detect CTAS in generated plan and issue my own sql query for DESC TABLE, but it's already happening in snowddl, and getting parsed and processed the same way I would.
Could also make the above change in my own local version of snowddl, but that would require an internal fork and following snowddl version updates.
Additional context
None.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I'm still using snowddl-convert/singledb plan to generate sql to update a target Snowflake d/b to match our git repo. One of the problems I'm trying to solve is detecting when a CTAS statement implicitly drops a column, so I can flag the generated plan sql for human review/approval. It looks like, within
TableResolver.compare_object()
there is a variable,unsafe_alters
that records the columns that are getting dropped (and probably some other stuff, too). It would make my problem case (column implicitly dropped by CTAS) easier to detect if the contents of that variable were emitted as a comment (ideally, one item per line), the same asreplace_reasons
.Describe the solution you'd like
This, or something like it:
Describe alternatives you've considered
Could detect CTAS in generated plan and issue my own sql query for DESC TABLE, but it's already happening in snowddl, and getting parsed and processed the same way I would.
Could also make the above change in my own local version of snowddl, but that would require an internal fork and following snowddl version updates.
Additional context
None.
The text was updated successfully, but these errors were encountered: