[CALCITE-5390] RelDecorrelator throws NullPointerException
Ticket: [CALCITE-5390]
My time for calcite contributions is limited. I will have time to continue this work only next month. If anyone wishes to take over or continue this task in the meantime, please feel free to do so. I currently have a draft solution, but it has a few problems that need resolving:
- Solution logic throws a
NullPointerExceptionin cases where a correlation variable is used but has not been properly introduced. This specifically happens in join plans where a subquery exists in the ON clause, but not in the WHERE clause. (See example: [CALCITE-7286]). Also in this case of [CALCITE-7286]LogicalJoinshould be replaced byLogicalCorrelate - Solution depends on a proposal to introduce a new
RelNode.copymethod with a 3rd parameter to replace the variablesSet [CALCITE-7280]. As suggested by Stamatis in a comment on this task, this functionality should probably be implemented using theRelBuilderinstead. - Better test coverage
- At the moment, code only compiles with Guava version 32.0 or higher because of
buildKeepingLast.
PR contains two commits. The first commit relates to [CALCITE-7280] (introducing copy method) and second contains the logic for the main fix itself. Feel free to add any comment you wish, especially if you know a better solution.
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 90 days if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.