Implements a few helper functions that, given a simplified schema and an sql statement, can determine what the names of the resulting columns are and from which original table and column they came from. We can use this together with our dlt schema to compute the dlt schema of a dataset query ahead of time and set the right hints.
Notes:
Does not support the concept of schemas and databases yet, do we need this? We'll have to see.
Basic queries with subqueries, renaming, aggregating and group by etc work. I'm pretty sure we will find queries that will not work, and I am not at all certain that my implementation is correct.
What will happen if there are qualified table names in the statement? Only god knows, this will be the next step :)
What happens if a result column has two ancestors, maybe if there is a concatenation of two strings or something like that?
Description
Implements a few helper functions that, given a simplified schema and an sql statement, can determine what the names of the resulting columns are and from which original table and column they came from. We can use this together with our dlt schema to compute the dlt schema of a dataset query ahead of time and set the right hints.
Notes: