Conversation
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
…r sqlite and mysql Signed-off-by: Luka Peschke <mail@lukapeschke.com>
|
this looks great! (I agree it's a bit clunky, but unless I'm misunderstanding, the result is very good! and we can re-architect one day™) I'll merge; @kgutwin if you have any feedback please add for a post-review! |
|
Glad for the merge! I agree that proper lineage tracking would be very useful here. In general, the SQL processing code is tough to follow and reason through (hence why @lukapeschke and I had so much trouble fixing these bugs) so any refactoring we could do for modularization or just better data structures would be a really good idea. Thanks! |
|
Is this something that should be mentioned in the changelog? |
yes, strongly agree... |
|
thanks for the quick merge 🎉 |
closes #5302
This fixes #5302 with two changes:
cid_redirectsafter compiling a relation (i.e. a pipeline), because we rely on them in the postprocess step for sorting. This is needed because CTEs get modified duringcompile_pipeline: some are merged or removed, and some are addedcid_mappings, and are then reverted "back" to the front, but we prefer using their alias when they are renamed. This allows to pass named columns around rather expressions, and ensure that the sort columns are available in the main pipeline, even with intermediaryselectsteps. An example where this is needed is the newgroup_sort_filter_derive_select_joinintegration test: if you remove the aliasing part, we will attempt sorting on a column that has been de-selected.The two changes feel a bit clunky (especially
alias_last_sorting), but I'm not really sure how to fix this without a proper lineage for columns 😕 Something ideal would be an object for every column, with information such as "this column comes from table X /expression Y, becomes FOO in table T, then BAR in table T2". It could avoid having to keepctesandrelation_instancesin sync.@kgutwin @max-sixty thanks a lot for your help on this one, it has made it much easier to dive into the code!