Anonymous Coward (816) has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/23524 )

Change subject: WIP: do not review, Calcite patch with most fixes for v1
......................................................................


Patch Set 8:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/23524/8/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java:

http://gerrit.cloudera.org:8080/#/c/23524/8/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteRelNodeConverter.java@268
PS8, Line 268: false
> Don't mind changing it to true, seems like the right thing to do, but do yo
CREATE TABLE dept(
    deptno INT,
    dname string,
    loc string
);

CREATE TABLE emp(
    empno INT ,
    ename string,
    job string,
    age INT,
    mgr INT,
    hiredate DATE,
    sal double,
    comm double,
    deptno INT,
    email string,
    create_datetime TIMESTAMP,
    upsert_time TIMESTAMP
);

SELECT e1.*, d.deptno
FROM emp e1
LEFT JOIN dept d
  ON e1.deptno = d.deptno
  AND d.deptno IN (
    SELECT e3.deptno
    FROM emp e3
    WHERE d.deptno > e3.comm
  )
ORDER BY e1.empno;


when https://issues.apache.org/jira/browse/CALCITE-7034 fixed, I want to check 
this fix in impala (I use 1.41.0-snapshot locally), but throw a 
RuntimeException:

Could not find a matching signature for call =($7, $9)


[Plan after subquery removal phase]
LogicalSort(sort0=[$0], dir0=[ASC]), id = 20
  LogicalProject(empno=[$0], ename=[$1], job=[$2], mgr=[$3], hiredate=[$4], 
sal=[$5], comm=[$6], deptno=[$7], DEPTNO0=[$8]), id = 18
    LogicalProject(empno=[$0], ename=[$1], job=[$2], mgr=[$3], hiredate=[$4], 
sal=[$5], comm=[$6], deptno=[$7], deptno0=[$8], dname=[$9], loc=[$10]), id = 41
      LogicalJoin(condition=[=($7, $8)], joinType=[left]), id = 39
        LogicalTableScan(table=[[testdb, emp]]), id = 1
        LogicalFilter(condition=[=($0, $3)]), id = 37
          LogicalCorrelate(correlation=[$cor0], joinType=[inner], 
requiredColumns=[{0}]), id = 35
            LogicalTableScan(table=[[testdb, dept]]), id = 3
            LogicalAggregate(group=[{0}]), id = 33
              LogicalProject(DEPTNO=[$7]), id = 31
                LogicalFilter(condition=[>(CAST($cor0.deptno):DOUBLE, $6)]), id 
= 29
                  LogicalTableScan(table=[[testdb, emp]]), id = 1

you can see LogicalTableScan(table=[[testdb, emp]]) have same id. This break 
RelDecorrelator.

so when you create HepPlanner, you should set noDAG=true.

If noDAG is false, create shared nodes if expressions are identical.



--
To view, visit http://gerrit.cloudera.org:8080/23524
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icc0d0101a8136d8ef7fe0d045af6d20828d62840
Gerrit-Change-Number: 23524
Gerrit-PatchSet: 8
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Anonymous Coward (816)
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Wed, 29 Oct 2025 02:20:04 +0000
Gerrit-HasComments: Yes

Reply via email to