We would like to extend this rule to support also outer joins.
Resolved in release 1.4.0-incubating (2015-08-23)
Fixed in https://git1-us-west.apache.org/repos/asf?p=incubator-calcite.git;a=commit;h=2376ae4a876b421ee19c2b2a05a6bd1d306e442b
My guess is that the nullability of columns changes when the expression is pulled up, and therefore the RexInputRef will need to be updated to the new type. Make sure you run with asserts enabled!
RexUtil.fixUp does something similar to what you want.
Running on problems related to data types when the rule is applied on the outer joins. I'm checking into this further.
And when you commit be sure to add 'Close apache/incubator-calcite#109' to the check-in comment.
1. I would like to limit the number of overloaded constructors - please remove one, and deprecate the existing one, as I described in the pull request.
2. Please add a test to RelOptRulesTest.
When you've done those go ahead and commit.
Here's the pull request: https://github.com/apache/incubator-calcite/pull/109
Julian Hyde, I have created a pull request for this issue. Could you take a look? Thanks