You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "hongyu guo (Jira)" <ji...@apache.org> on 2023/07/04 03:32:00 UTC
[jira] [Updated] (CALCITE-5816) query with LEFT SEMI JOIN should not refer to RHS columns
[ https://issues.apache.org/jira/browse/CALCITE-5816?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
hongyu guo updated CALCITE-5816:
--------------------------------
Summary: query with LEFT SEMI JOIN should not refer to RHS columns (was: Wrong result for query with LEFT SEMI JOIN )
> query with LEFT SEMI JOIN should not refer to RHS columns
> ---------------------------------------------------------
>
> 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
> Priority: Minor
> Labels: pull-request-available
>
> A LEFT SEMI JOIN can only return columns from the left-hand table.
> But calcite also return both left-hand and right-hand table columns.
> In [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)