-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implicit individual/variable functions in PROBABILITY OF (...) #535
Comments
|
Two alternative approaches: Temporary SQL functionsIn an implied-variable (or implied-row) context -- i.e.,
the function bql_temp_fn_123 would assemble and execute the query
with its argument substituted for To do this we must:
This plan is more clearly articulated up front with fewer unknowns, but likely has a longer long-term maintenance burden (additional complexity in the BQL->SQL compiler), and no long-term benefits. Virtual tables with table-valued functionsCreate a virtual table with table-valued functions for performing the
queries, so that we can compile that into:
Then it should be trivial to do the same for implicit variables in some context. To do this we must:
This plan has more unknowns: there is a bug in sqlite3 affecting virtual tables which might affect us (need to spend an hour or so to review it to be sure), and there may be complexities in working with virtual tables that will come up in the 'mess around' stage requiring adjustment of the rest of the plan. However, I expect it to improve the long-term maintainability of the compiler, and I expect the same mechanism to be useful for other things -- e.g., making it easier to parallelize more queries, and make more of BQL composable and nestable. |
Draft is committed and lightly tested. Could use more testing. |
Need to transmit the implicit variable into MUTUAL INFORMATION.
This is not trivial!
The text was updated successfully, but these errors were encountered: