Affects Version/s: None
Fix Version/s: None
Optiq incorrectly pushes filter down window aggregation, thus window aggregates get wrong input data resulting in incorrect result.
The actual result is: empid=100; C=1
The plan is as follows:
I have no idea why PushFilterPastProjectRule is executed before WindowedAggSplitterRule.PROJECT.
At best we should allow pushing filters that use expressions matching PARTITION BY expressions.
I am not sure that is easy to do in ProjectRel_with_RexOvers form.
I guess it would be easier if we create WindowRel first, and then have dedicated PushFilterPastWindowRel rule.
At least we should deny PushFilterPastProjectRule when Project contains RexOver.