As a user with a custom Calcite adapter that does push down, I should be able to run a UNION query of statements containing joins and still get the benefit of projection push down.
Given a query such as:
I expect a resulting query plan that looks like:
But instead I observed:
- The EnumerableCalc node applied to the EnumerableMergeJoin goes from taking 1 expected input field to taking 251 input fields
- The MyProject node expected to be applied to MyTableScan(table=[[MySchema, t3]]) is missing from the observed plan
- Issue was observed after upgrading from 1.24 to 1.29, so may affect one or more intervening releases
- PR containing reproducing unit test: https://github.com/apache/calcite/pull/2747