Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1792

RelToSqlConverter doesn't handle cartesian join (join cond as TRUE)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: jdbc-adapter
    • Labels:
      None

      Description

      this test fails (added in RelToSqlConverterTest):

          @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);
        }
      

      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():

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbalint@gmail.com Jess Balint
                Reporter:
                ssimonov Sergiy Simonov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: