Replies: 1 comment 2 replies
-
you can run the optimizer with just qualify columns and qualify tables |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What would be the best way to rename the tables and columns in a query, ensuring that the query is still functionally the same?
E.g., given a query:
and renaming dictionaries (which I will ensure are bijections):
Additionally I can provide the schema dict if needed:
I would like the resulting query to be:
I am mainly worried about how to make sure that
old_q
doesn't get renamed, as it's an alias, not the actual column name, even though it is present in the dictionary. In the above example, optimization removes the subquery, so the renaming is actually not hard afterwards. But I assume optimization will not always be able to do so, and some more complex examples might, even after optimization, still have edge cases like the one above.For reference, this is what I have done so far, but I am very unhappy with it, firstly because I do not understand if it's actually correct in general, and second because it runs the whole optimization, and Ideally I would not have to run it, or at least I could only run the necessary steps (but I do not know which ones are necessary).
Beta Was this translation helpful? Give feedback.
All reactions