[ 
https://issues.apache.org/jira/browse/CALCITE-7077?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17986649#comment-17986649
 ] 

Zhen Chen commented on CALCITE-7077:
------------------------------------

Yes, in JoinExpandOrToUnionRule, FULL JOIN is actually converted to INNER JOIN 
+ ANTI JOIN. But I am worried whether ANTI JOIN can be supported when converted 
to SQL. The purpose of this rule is to allow dialects that do not support FULL 
JOIN to rewrite it in the form of LEFT + RIGHT JOIN so that this dialect can 
execute it. This rule may not have any optimization effect. 

> Implement a rule to rewrite FULL JOIN as LEFT JOIN and RIGHT JOIN
> -----------------------------------------------------------------
>
>                 Key: CALCITE-7077
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7077
>             Project: Calcite
>          Issue Type: New Feature
>            Reporter: Zhen Chen
>            Assignee: Zhen Chen
>            Priority: Minor
>
> Invalid unparse for FULL JOIN in MySQLDialect is described in CALCITE-7050. 
> The purpose is to allow SQL dialects that do not support FULL JOIN to execute 
> according to the semantics of FULL JOIN. For this, a rule can be implemented 
> to rewrite FULL JOIN into LEFT JOIN and RIGHT JOIN. For example:
> original sql:
> {code:java}
> SELECT *
> FROM Employees e
> FULL JOIN Departments d ON e.id = d.id
> {code}
> rewrite into
> {code:java}
> SELECT *
> FROM Employees e
> LEFT JOIN Departments d ON e.id = d.id
> UNION ALL
> SELECT *
> FROM Employees e
> RIGHT JOIN Departments d ON e.id = d.id
> where e.id is null; 
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to