[CALCITE-7405] Pre-process expressions for correlations before building projection in SqlToRelConverter#4779
Conversation
xuzifu666
left a comment
There was a problem hiding this comment.
Need to fix CI error first.
| /.vscode/* | ||
|
|
||
| # IDEA | ||
| /out |
There was a problem hiding this comment.
When I run with intellij, git detected a ton of extra files.
6338b8f to
3784f65
Compare
…ng projection in SqlToRelConverter, simplify some gitignore paths
3784f65 to
5314e24
Compare
|
|
If we create a temporary |
Thats not an unreasonable suggestion, however I expect that change would also create a lot of test changes, both in this project and anything downstream. |
|
I prefer a simpler, more intuitive processing logic, even if it affects some of the original plans. As you mentioned, are there other places where similar issues arise, and would it be better to have a unified logic for handling them? |



To circumvent the bloat optimizations, it is necessary to provide the correlation variables (if they exist) to the builder.
The main change here is to accomplish the logic done in
SqlToRelConverter.getCorrelationswithout having built the Project node.In this way we (a) extract the correlation id to use for the RelBuilder, and (b) normalize/resolve the correlation ids and rewrite the expressions; all before invoking the RelBuilder.
I've done my best to reuse existing logic.
SqlToRelConverter.getCorrelationsandSqlToRelConverter.massageExpressionsForCorrelationrequire a lot of the same logic for resolving the correlation variables for the current scope, so that was moved to a common utility method (SqlToRelConverter.getCorrelationInfo).