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

Julian Hyde commented on CALCITE-1792:
--------------------------------------

There seem to be 2 changes here: 1 handle TRUE; 2 move away from "," towards 
"INNER JOIN".

I'm not convinced on 2. All databases can handle "select ... from emp, dept" 
but I'm not sure all can handle "select ... from emp inner join dept on true". 
Oracle for instance.

Regarding 1. You could have added "case Literal:" inside 
convertConditionToSqlNode and that would have solved the problem.

> RelToSqlConverter doesn't handle cartesian join (join cond as TRUE)
> -------------------------------------------------------------------
>
>                 Key: CALCITE-1792
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1792
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Sergiy Simonov
>            Assignee: Jess Balint
>            Priority: Minor
>             Fix For: 1.12.0
>
>
> this test fails (added in {{RelToSqlConverterTest}}):
> {code}
>     @Test public void testCartesianProductWithFullJoinSyntax() {
>     String query = "select * from \"department\"\n"
>             + "FULL JOIN \"employee\" ON TRUE";
>     String expected = "SELECT *\nFROM \"foodmart\".\"department\"\n"
>             + "FULL JOIN \"foodmart\".\"employee\" ON TRUE";
>     sql(query).ok(expected);
>   }
> {code}
> {{RelToSqlConverter}} is checking that the join condition is a {{RexCall}}. 
> In this case (and {{RelBuilder.join()}} with no join cond), the join cond is 
> a {{RexLiteral}} with a value of {{true}}.
> Suggested fix is to handle the case with this specific join condition before 
> {{convertConditionToSqlNode()}}:



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to