Hi, I am trying to get a better understanding of calcite.

I tried running the JdbcExample* using calcite 1.35.0 but with this query:

explain plan for
select distinct \"cust_id\"
from "foodmart"."sales_fact_1997" as s
left join "hr"."emps" as e on e."empid" = s."cust_id"

The output is
EnumerableAggregate(group=[{0}])
  EnumerableMergeJoin(condition=[=($0, $1)], joinType=[left])
    EnumerableSort(sort0=[$0], dir0=[ASC])
      EnumerableCalc(expr#0..1=[{inputs}], cust_id=[$t0])
        EnumerableTableScan(table=[[foodmart, sales_fact_1997]])
    EnumerableSort(sort0=[$0], dir0=[ASC])
      EnumerableCalc(expr#0..1=[{inputs}], empid=[$t0])
        EnumerableTableScan(table=[[hr, emps]])

I was expecting AggregateJoinRemoveRule to remove the join and the scan of emps.

Is this just a bug or do I need to run calcite in a different way?

thanks for any help,
Thomas

* 
https://github.com/apache/calcite/blob/main/core/src/test/java/org/apache/calcite/examples/foodmart/java/JdbcExample.java

Reply via email to