calcite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From 董 一峰 <donga...@outlook.com>
Subject [DISCUSS] Why ProjectRemoveRule dose not consider field name when apply this rule
Date Wed, 27 May 2020 12:38:15 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message