disney / quanta

Access large data sets in true "real time" fashion. Millisecond queries and live updates.
Other
24 stars 10 forks source link

added 'views' and view test #101

Closed awootton closed 11 months ago

guymolinari commented 1 year ago

Alan. Instead of parsing the query yourself call the qlbridge rel.ParseSql. It should return a SqlCreate object that contains a SqlSelect.

The query rewriter is a start conceptually but 9 times out of 10 a view will contain a join of 2 or more tables. If you have the parsed SqlSelect object then you can iterate over the SqlSelect.From array and process all of the individual tables. The simple "parsing" logic inside the proxy is just used to dispatch to the sqldriver Query or Exec functions. A "Create view" statement would be processed as an "Exec". It's fine to parse and rewrite the query inside the proxy main loop if it makes sense or you can push this code inside qlbridge. I don't think this is complete enough to merge yet. Much more work to do.