Uh oh!
There was an error while loading. Please reload this page.
fix(prqlc): deduplicate selected items in gen_projection - #5305
Conversation
lukapeschke
commented
May 26, 2025
After spending a while digging into the intermediary steps, this is my naive attempt at solving #5302 . However I'm not satisfied with it: Deduplicating what we have in I see a few things in the SQL output that could be solved:
@max-sixty do you have any ideas/hints on how I could move forward with this ? Thanks in advance! |
max-sixty
commented
May 26, 2025
hi @lukapeschke, and thanks for the contribution! is there an example of the proposed code behaving worse than the existing code? otherwise this seems like an upgrade... (I agree it's not perfect, but making incremental improvements is still good...) |
lukapeschke
commented
May 27, 2025
@max-sixty I've no example of this behaving worse than existing code. You're right, we can proceed with incremental improvements. I simplified I'll try to address the other issues in different PRs if that's okay with you ? My next step will be to try to change |
#5310 adresses the second point in this comment. I guess this needs to be done earlier in the process to prevent |
fixesPRQL#5302 Signed-off-by: Luka Peschke <mail@lukapeschke.com>
…ple aliases work as expected in the test Signed-off-by: Luka Peschke <mail@lukapeschke.com>
Signed-off-by: Luka Peschke <mail@lukapeschke.com>
max-sixty
commented
Jun 11, 2025
sorry I missed this @lukapeschke ! I missed a couple of others too, but am back & merging things! I'll merge this. I'm a tiiiiny bit hesitant that we're just removing any duplicate columns — there may be times that people expect duplicate columns to persist, and ideally we'd solve this at a different stage in the compiler but given where we're at, the result does seem better, and endlessly pushing off small improvements in the hope of fixing underlying compiler issues doesn't seem like a successful strategy :) thank you for the contribution! |
lukapeschke
commented
Jun 17, 2025
Thanks a lot for the merge @max-sixty :) I think I've finally found the underlying issue, details here: #5302 (comment) I'm not really sure about how to proceed to fix it though, I'm not sure what the condition should be to determine if the sort columns should be reverted or not... Maybe you have an idea ? Also, could you please re-open #5302 since it's not completely fixed yet ? I don't have the rights to do it |
fixes#5302