ProjectWindowTransposeRule would produce a LogicalWindow which mis-refers constant fields. A query like:
where the inner query generates columns which are never used in the main query. If we use the three rules in the hep planner:
we will get a plan:
Note that the second SUM() in the LogicalWindow should have pointed to the second constant (i.e., $3).