For co-related queries such as
Calcite generates following plan (SubqueryRemove Rule + Decorrelation)
As you can notice there is a outer table scan (EMP in this case) to retrieve all distinct values for co-related column (EMP.JOB here), which is then joined with inner table (DEPT).
I am not sure why is this step required. After this join Calcite is anyway doing group by to generate all distinct values for correlated and result column (DEPTNO, JOB) which is then joined with outer table.
I think the scan + join of outer table with inner table to generate co-rrelated values is un-necessary and is not required.