[
https://issues.apache.org/jira/browse/CALCITE-5816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17739675#comment-17739675
]
Julian Hyde edited comment on CALCITE-5816 at 7/3/23 4:05 PM:
--------------------------------------------------------------
You neglect to mention that LEFT SEMI JOIN syntax is only supported in Babel.
Babel doesn’t claim to execute or validate queries, just parse them.
Is this issue just about expanding “*”? If not, you should test that referring
to a column from the RHS in the SELECT or WHERE clause is invalid.
Add one or two comments. E.g. In select.iq describe why the type is what it is.
In the core code note that LEFT_SEMI_JOIN can only come from Babel.
And link to other relevant Jira.
Correct the summary. Calcite does not return “wrong result”. AFAIK it can’t
even execute.
was (Author: jhyde):
You neglect to mention that LEFT SEMI JOIN syntax is only supported in Babel.
Babel doesn’t claim to execute or validate queries, just parse them.
Is this issue just about expanding “*”? If not, you should test that referring
to a column from the RHS in the SELECT or WHERE clause is invalid.
Add one or two comments. E.g. In select.iq describe why the type is what it is.
In the core code note that LEFT_SEMI_JOIN can only come from Babel.
And link to other relevant Jira.
> 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
> 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)