hongyu guo created CALCITE-5816:
-----------------------------------
Summary: Wrong result for query with LEFT SEMI JOIN
Key: CALCITE-5816
URL: https://issues.apache.org/jira/browse/CALCITE-5816
Project: Calcite
Issue Type: Bug
Components: babel, core
Affects Versions: 1.34.0
Reporter: hongyu guo
Assignee: hongyu guo
A LEFT SEMI JOIN can only return columns from the left-hand table.
But calcite also return right-hand table columns.
[select.iq|https://github.com/apache/calcite/blob/c0f2e9b50e7e61fe732a07d04786d5df95aa557e/babel/src/test/resources/sql/select.iq]
{code:sql}
# LEFT SEMI JOIN (Hive only)
SELECT *
FROM emp LEFT SEMI JOIN dept ON emp.deptno = dept.deptno;
SELECT "EMP"."EMPNO", "EMP"."ENAME", "EMP"."JOB", "EMP"."MGR",
"EMP"."HIREDATE", "EMP"."SAL", "EMP"."COMM", "EMP"."DEPTNO", "DEPT"."DEPTNO" AS
"DEPTNO0", "DEPT"."DNAME", "DEPT"."LOC"
FROM "scott"."EMP" AS "EMP"
LEFT SEMI JOIN "scott"."DEPT" AS "DEPT" ON "EMP"."DEPTNO" = "DEPT"."DEPTNO"
!explain-validated-on hive
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)