Hello everyone,
When we run the following test case:
SQL:
WITH T_CTE (i1_cte, i2_cte) AS (
SELECT
i1,
d3
FROM
t1
)
SELECT
*
FROM
t2
JOIN T_CTE ON (t2.i1 = T_CTE.i1_cte)
Logical Plan(After ProjectRemoveRule):
LogicalJoin(condition=[=($0, $14)], joinType=[inner])
:- LogicalTableScan(table=[[default, db1, t2]])
+- LogicalCalc(expr#0..13=[{inputs}], i1=[$t0], d3=[$t2])
+- LogicalTableScan(table=[[default, db1, t1]])
We wish the output column name contain i1_cte, i2_cte, but calcite just drop it.
After analysisinp the calcite code, we found the rule named ProjectRemoveRule,
it will remove the project if project and its input has same size and type, but
it confused me, why this rule dose not consider the field name when remove
project?
Best Regards
Axis